Changes since 23.6.10
Fixes
-
Prevent deadlock on concurrent push and disconnect (CP: 23.7) (#24229) (CP: 23.6)
Commit · Pull requestThis PR cherry-picks changes from the original PR #24229 to branch 23.6. --- #### Original PR description > The previous
AtomicBooleanguard inAtmospherePushConnectionclosed only the disconnect-vs-disconnect race. A push thread that readsdisconnectingas false before a concurrentdisconnect()flips it can still proceed intosynchronized(lock)behind the disconnect thread, which is itself blocked insideresource.close()waiting for the servlet container's HTTP session lock held by the push thread — a two-lock cycle. > > Moveresource.close()out of the monitor: insidesynchronized(lock)capture the resource into a local and callconnectionLost()to transition the state, then release the monitor before invokingclose()on the stashed reference. Add a matching re-check ofisConnected()at the top of thesynchronizedblock inpush()so a push that waited for the monitor observes the late disconnect and defers viaPUSH_PENDING/RESPONSE_PENDINGinstead of NPEing on the cleared resource. Thedisconnectingflag stays set untilclose()returns so subsequent pushes take the fast path and no newdisconnect()re-enters whileclose()is still in flight. > > Related-to #24192 -
Fix potential deadlock in AtmospherePushConnection disconnect (#24133) (CP: 23.6)
Commit · Pull requestThis PR cherry-picks changes from the original PR #24133 to branch 23.6. --- #### Original PR description > Fixes #24129