Skip to content
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

Push connection status tracking should not be related to Vaadin session lock #6398

Closed
vaadin-bot opened this issue Feb 25, 2015 · 2 comments
Closed
Labels

Comments

@vaadin-bot
Copy link
Collaborator

Originally by @Artur-


Today there are two entities regarding push

  1. PushHandler + Atmosphere. Handles connections
  2. UI + PushConnection

There seems to be a problem with synchronization between the two entities. UI + PushConnection and locked by the VaadinSession lock, while PushHandler + Atmosphere are synchronized the way Atmosphere synchronizes. Set up this way, there is no way for PushHandler to immediately update the connection status when it changes and consequently the UI code can't react according to the current status.

With the initial fix for #15330 (vaadin/vaadin@3c07368) which tries to ensure all events are triggered in the correct order for long polling, this problem becomes obvious. The UI in https://dev.vaadin.com/review/7599 which does two push() calls in the same access block causes assertion errors because the state updates for PushConnection are not the expected

disconnected, connected, disconnected, connected

but instead

disconnected, disconnected, connected, connected

Imported from https://dev.vaadin.com/ issue #16919

@vaadin-bot
Copy link
Collaborator Author

Originally by @Artur-


This should not be a huge issue as the "connected" state is used only to know that the connection might be available, and Atmosphere does the actual connection tracking.

@vaadin-bot
Copy link
Collaborator Author

vaadin-bot commented Oct 7, 2016

Originally by @Artur-


This causes #6943 and is an issue because servers tend to lock the WebSocket connection when processing a message. This can lead to a deadlock where one thread has the VaadinSession lock and tries to disconnect the websocket connection and another thread has the websocket connection lock and tries to get the VaadinSession lock to be able to update the connection state

@vaadin-bot vaadin-bot added the bug label Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant