[PR] Fix automatic pong close race [tomcat]

moritzfl (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]>
moritzfl opened a new pull request, #1041:
URL: https://github.com/apache/tomcat/pull/1041

   ## Fix automatic Pong/session-close race
   
   A WebSocket session may begin closing after `WsFrameBase` checks `WsSession.isOpen()` but before it calls `sendPong()`. In that interval, `sendPong()` throws `IllegalStateException` on the inbound frame-processing thread.
   
   Suppress this exception only when closing has begun; propagate it otherwise. Add regression coverage for both outcomes.
   
   ### Backport applicability
   
   The same non-atomic `isOpen()` / `sendPong()` sequence exists in all supported release branches: `11.0.x`, `10.1.x`, and `9.0.x`. These should be considered for backport after merge to `main`. We would need a fix for `11.0.x` at the company I work for.
   
   ### Testing
   
   `ant test` with JDK 21.0.9 ran for 57m57s on my Windows machine but failed due to broad NIO2 test discovery failures (`No tests found`) affecting unrelated tests. The added `TestWsFrame` coverage passed under NIO: 4 tests, 0 failures.


-- 
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.