Skip to content

fix: prevent deadlock on concurrent push disconnection (#16544) (CP: 24.0)#16580

Merged
vaadin-bot merged 1 commit into
24.0from
cherry-pick-16544-to-24.0-1681401157803
Apr 13, 2023
Merged

fix: prevent deadlock on concurrent push disconnection (#16544) (CP: 24.0)#16580
vaadin-bot merged 1 commit into
24.0from
cherry-pick-16544-to-24.0-1681401157803

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

No description provided.

If the AtmospherePushConnection.disconnect method is invoked concurrently
by multiple threads, a deadlock may happen if the servlet container
somehow locks HTTP session, as closing AtmosphereResource may cause
accesses to the HTTP session.
For example, is a thread (A) is invalidating the HTTP session, thus closing
Vaadin UIs and disconnecting push, and another thread (B) is also
requesting a push disconnect, then B will be blocked when closing the
atmosphere resource by the lock on the session held by A, but A is
actually waiting to acquire the lock on AtmospherePushConnection held by B,
causing the deadlock.
This change allows a single thread to perform the disconnect operation,
to avoid potential deadlocks.

Fixes #16293
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

This PR is eligible for auto-merging policy, so it has been approved automatically. If there are pending conditions, auto merge (with 'squash' method) has been enabled for this PR[Message is sent from bot]

@vaadin-bot vaadin-bot enabled auto-merge (squash) April 13, 2023 16:04
@github-actions

Copy link
Copy Markdown

Test Results

   948 files  ±0     948 suites  ±0   57m 47s ⏱️ - 2m 56s
6 009 tests +1  5 974 ✔️ +1  35 💤 ±0  0 ±0 
6 266 runs  +7  6 224 ✔️ +5  42 💤 +2  0 ±0 

Results for commit 0b8d43a. ± Comparison against base commit 15f747d.

@vaadin-bot vaadin-bot merged commit b5bd017 into 24.0 Apr 13, 2023
@vaadin-bot vaadin-bot deleted the cherry-pick-16544-to-24.0-1681401157803 branch April 13, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants