New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot invoke "org.atmosphere.cpr.AtmosphereResource.getBroadcaster()" because the return value of "com.vaadin.flow.server.communication.AtmospherePushConnection.getResource()" is null #15571
Comments
Now updated with a minimal application exhibiting this behaviour. It seems that this exception occurs when the |
I've also confirmed that same issue occurs on Vaadin 23.3.1 / MPR 6.1.0. |
Thanks for the issue report. As this is quite clearly not bug in Vaadin 8, but possibly something either in Flow or MPR, I am going to move the ticket to either one of the repositories. |
Just noting that 6.1.1 exists already. https://github.com/vaadin/multiplatform-runtime/releases/tag/6.1.1 |
Still happens event with the fix. https://github.com/vaadin/framework/blob/master/server/src/main/java/com/vaadin/ui/UI.java#L517-L526 |
I can confirm that the problem is originated by the thread started by Vaadin 8 to disconnect PUSH. |
Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test Co-authored-by: Marco Collovati <marco@vaadin.com>
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test Co-authored-by: Marco Collovati <marco@vaadin.com>
* fix: prevent concurrent disconnect and push operations Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571 * fixed test Co-authored-by: Marco Collovati <marco@vaadin.com>
Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571
Disconnecting an AtmospherePushConnection while it is sending a message may result in a NullPointerException if AtmosphereResource is nullified before the message is sent. This change synchronizes operations, so that disconnect will wait until current push finishes, or push waits for disconnect to complete so that the isConnected() method reflects correctly current state. Fixes #15571
This ticket/PR has been released with Vaadin 23.2.16. |
This ticket/PR has been released with Vaadin 23.3.6. |
This ticket/PR has been released with Vaadin 14.9.6. |
This ticket/PR has been released with Vaadin 24.0.0.beta2 and is also targeting the upcoming stable 24.0.0 version. |
Upon session destruction through
HttpSession.invalidate()
, the following stack trace is often seen:In turn, this means that any
SessionDestroyListener
s registered to be executed upon Vaadin session destruction will not be called (seecom.vaadin.flow.server.VaadinService#fireSessionDestroy
) as the exception is not caught.Looking at the code, it seems that there is some attempt to guard against the
resource
being null, but it does appear that theresource
is null at the point the push is attempted.Minimal Reproducible Example
The following application exhibits this behaviour:
mpr-demo-mpr-6-atmosphere-push.zip
Start the application:
Navigate to the following, which will open the view and schedule a session invalidation in 5 seconds time.
View console output, see stack trace as shown in
Actual Behaviour
sctionExpected behaviour
All
SessionDestroyListener
s should be allowed to run as part of session destruction, even in the case of issues with the AtmospherePushConnection.Actual behaviour
Exception thrown and
SessionDestroyListener
s not executed:Versions:
Vaadin Framework: 8.16.1
Flow: 23.2.5
MPR: 6.0.2
Java JRE / JDK: 17
openjdk 17.0.2 2022-01-18 LTS
OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2+8-LTS, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: