You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "moritzfl (via GitHub)" <gi...@apache.org> on 2026/08/13 06:58:03 UTC
[PR] Fix automatic pong close race [tomcat]
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: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] Fix automatic pong close race [tomcat]
Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf commented on PR #1041:
URL: https://github.com/apache/tomcat/pull/1041#issuecomment-5292117314
Thanks for the PR. Looks good. I'll also take care of back ports.
--
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: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] Fix automatic pong close race [tomcat]
Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf merged PR #1041:
URL: https://github.com/apache/tomcat/pull/1041
--
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: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org