davsclaus opened a new pull request, #27911: URL: https://github.com/apache/camel/pull/27911
_Claude Code on behalf of @davsclaus_ [CAMEL-25693](https://issues.apache.org/jira/browse/CAMEL-25693) ## Problem When `VertxWebsocketEndpoint.getWebSocket()` stops waiting for a connect (the `connectTimeout` passed), it cancels the connect future so that a connect finishing later closes its own WebSocket. If the connect finished in the short window between the timeout and the cancel, the WebSocket completed the future, `cancel(false)` had no effect, and nothing closed the WebSocket. The connection then stayed open on both sides until the server closed it. gnodet-bot found this in the review of the 4.22.x backport #27904 (CAMEL-25582 / CAMEL-25601). The same code is on main. ## Fix The new package-private `abandonConnect(future)` cancels the future. When the cancel comes too late, and the connect succeeded, it closes the WebSocket the future holds. A failed connect needs nothing. ## Tests `VertxWebsocketAbandonConnectTest` covers a connect that completed before the cancel (the WebSocket gets closed), a pending connect (cancelled), and a failed connect (left alone). `mvn verify` in `camel-vertx-websocket`: 112 tests, 0 failures. The leak only happens on a connect timeout, so this is a candidate for a 4.22.x backport after merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
