-
Notifications
You must be signed in to change notification settings - Fork 167
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
Connection to backend lost after network interruption when using websockets #20213
Comments
By default, Atmosphere does not call However, in both cases, the |
Just reset Another interesting thing is that, by default, Atmosphere will downgrade to the fallback transport if the first web socket reconnection attempt fails. Luckily, there's an Atmosphere configuration property ( In addition, So a potential fixes in Flow client could be:
|
When a websocket PUSH connection is closed and re-established because of a network failure, the RequestResponseTracker.hasActiveRequest is not reset, prenvint the Flow client to send additional messages to the server. This change will reset the flag on reconnection. It also will track unsent PUSH message over websocket, to retry the delivery once the connection is re-established, preventing client resynchronization. In addition, it sets a default value of 12 for the Atmospehere maxWebsocketErrorRetries setting, to ensure that the Flow client will attempt to reconnect with web socket transport several times, instead of immediately downgrade to long-polling after first failed connection. Fixes #20213
The above listed fixes look slightly related to a bigger mechanism described in #20348. |
…ion (#20283) * fix: resume client to server communication after web socket reconnection When a websocket PUSH connection is closed and re-established because of a network failure, the RequestResponseTracker.hasActiveRequest is not reset, prenvint the Flow client to send additional messages to the server. This change will reset the flag on reconnection. It also will track unsent PUSH message over websocket, to retry the delivery once the connection is re-established, preventing client resynchronization. In addition, it sets a default value of 12 for the Atmospehere maxWebsocketErrorRetries setting, to ensure that the Flow client will attempt to reconnect with web socket transport several times, instead of immediately downgrade to long-polling after first failed connection. Fixes #20213 * upgrade to atmosphere javascript 4.0.1 with reconnection fixes --------- Co-authored-by: Mikhail Shabarov <[email protected]>
…ion (#20283) * fix: resume client to server communication after web socket reconnection When a websocket PUSH connection is closed and re-established because of a network failure, the RequestResponseTracker.hasActiveRequest is not reset, prenvint the Flow client to send additional messages to the server. This change will reset the flag on reconnection. It also will track unsent PUSH message over websocket, to retry the delivery once the connection is re-established, preventing client resynchronization. In addition, it sets a default value of 12 for the Atmospehere maxWebsocketErrorRetries setting, to ensure that the Flow client will attempt to reconnect with web socket transport several times, instead of immediately downgrade to long-polling after first failed connection. Fixes #20213 * upgrade to atmosphere javascript 4.0.1 with reconnection fixes --------- Co-authored-by: Mikhail Shabarov <[email protected]>
…ion (#20283) (#20423) * fix: resume client to server communication after web socket reconnection When a websocket PUSH connection is closed and re-established because of a network failure, the RequestResponseTracker.hasActiveRequest is not reset, prenvint the Flow client to send additional messages to the server. This change will reset the flag on reconnection. It also will track unsent PUSH message over websocket, to retry the delivery once the connection is re-established, preventing client resynchronization. In addition, it sets a default value of 12 for the Atmospehere maxWebsocketErrorRetries setting, to ensure that the Flow client will attempt to reconnect with web socket transport several times, instead of immediately downgrade to long-polling after first failed connection. Fixes #20213 * upgrade to atmosphere javascript 4.0.1 with reconnection fixes --------- Co-authored-by: Marco Collovati <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]>
…ion (#20283) (#20424) * fix: resume client to server communication after web socket reconnection When a websocket PUSH connection is closed and re-established because of a network failure, the RequestResponseTracker.hasActiveRequest is not reset, prenvint the Flow client to send additional messages to the server. This change will reset the flag on reconnection. It also will track unsent PUSH message over websocket, to retry the delivery once the connection is re-established, preventing client resynchronization. In addition, it sets a default value of 12 for the Atmospehere maxWebsocketErrorRetries setting, to ensure that the Flow client will attempt to reconnect with web socket transport several times, instead of immediately downgrade to long-polling after first failed connection. Fixes #20213 * upgrade to atmosphere javascript 4.0.1 with reconnection fixes --------- Co-authored-by: Marco Collovati <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]>
This ticket/PR has been released with Vaadin 24.5.4. |
Description of the bug
I used the vaadin gradle starter skeleton to have a minimal reproducing example and changed AppShell.java to add a push annotation
After starting using
jettyRun
. I open the app in a browser in a virtual machine (I used VirtualBox and libvirt).I type in something and verify I get a result. I change the textbox content.
Then I virtually pull the cable.
In libvirt this can be done as follows, start
virsh
. Find out machine name (domain<dom>
) usinglist
, find out interface () usingdomiflist <dom>
. 'Pull cable' usingdomif-setlink <dom> <iface> down
.It is not sufficient to use the developer tools. That does not interrupt the websocket connection.
Press 'Say hello' again to send something and wait some time (best reproduced when browser print something like
'Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). - wasClean: false')
Then reconnect the network (
domif-setlink <dom> <iface> up
).And observe that nothing is send any more.
Expected behavior
The connection is reestablished and interaction is possible again.
I do not know if the last update should still be pushed or if resynchronization is better.
Minimal reproducible example
I downloaded https://github.com/vaadin/base-starter-gradle and applied the change above. I copied the code when vaadin version was 2.4.10
Versions
The text was updated successfully, but these errors were encountered: