zimmermq opened a new pull request, #910:
URL: https://github.com/apache/mina-sshd/pull/910

   Fixes #909.
   
   When a write started under the read lock in `writeOrEnqueue()` fails inline, 
the session close re-enters  KexOutputHandler.shutdown()` → `updateState()`, 
which tries to take the write lock on the same thread — an illegal 
read-to-write upgrade that self-deadlocks.
   
   Fix: in `shutdown()`, when the current thread already holds the read lock 
(`getReadHoldCount() > 0`), update the state without acquiring the write lock. 
The read lock already excludes writers, so it stays consistent; KEX 
write-ordering is unchanged.
   
   Includes a deterministic regression test (hangs without the fix, passes with 
it).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to