question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException on connection disposal

See original GitHub issue

Hey, 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:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rstoyanchevcommented, Oct 6, 2020

This should be resolved now.

1reaction
OlegDokukacommented, Oct 1, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found