NullPointerException on connection disposal
See original GitHub issueHey, folks!
We’ve noticed the following error periodically when the connections are being disposed. If I’m reading the exception correctly, it seems like the collection stores null
at some point.
java.lang.NullPointerException: null
at java.lang.Iterable.forEach(Iterable.java:75)
at io.rsocket.core.RSocketResponder.cleanUpSendingSubscriptions(RSocketResponder.java:274)
at io.rsocket.core.RSocketResponder.cleanup(RSocketResponder.java:264)
at io.rsocket.core.RSocketResponder.tryTerminate(RSocketResponder.java:166)
at io.rsocket.core.RSocketResponder.tryTerminateOnConnectionClose(RSocketResponder.java:159)
at reactor.core.publisher.LambdaMonoSubscriber.onComplete(LambdaMonoSubscriber.java:132)
at reactor.core.publisher.MonoProcessor$NextInner.onComplete(MonoProcessor.java:518)
at reactor.core.publisher.MonoProcessor.onNext(MonoProcessor.java:308)
at reactor.core.publisher.MonoProcessor.onComplete(MonoProcessor.java:265)
at io.rsocket.internal.BaseDuplexConnection.dispose(BaseDuplexConnection.java:23)
at ...
Steps to Reproduce
It seems that the error isn’t easily reproducible. We’re only seeing very rarely, once or twice a day.
Your Environment
- RSocket version(s) used: 1.0.1
- Other relevant libraries versions (eg.
netty
, …): none - Platform (eg. JVM version (
javar -version
) or Node version (node --version
)): 13 - OS and version (eg
uname -a
): ubuntu 20.04
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Dispose(); causing a null pointer exception error in java
When I try to run the code, it gives me this error. So, If I'm correct is adminmain() or usermain() are from different...
Read more >Unexpected NullPointerException thrown from a Connection ...
When executing operations on a server-side Partitioned region from multiple threads concurrently using a single client connection pool, a Java ...
Read more >Updating Table Gives java.lang.NullPointerException
ive been trying to solve this problem for ages and cant figure it out! heres my method code: public void editContact(ContactPanel updatePanel){ try{ ......
Read more >NullPointerException while inserting in Database - CodeRanch
This returns a Connection object. You are doing nothing with that Connection object and are, instead, using the null reference 'conn' instead.
Read more >Java static code analysis: "NullPointerException" should not ...
NullPointerException should be avoided, not caught. Any situation in which NullPointerException is explicitly caught can easily be converted to a null test, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be resolved now.
Hey @SerCeMan!
Thank you for reporting that! I will have a look.
On the root-cause… Not sure we put null somewhere, it is more likely a racing between cleanup during disposal and a stream that does self-removal from the same collection when it is terminated.
So it may be that the iterator has seen an element but a collection has already been shrunken so once a next is called, the element being observed is null, hence we see NPE.