[backport camel-4.22.x] CAMEL-24789: camel-vertx-websocket - finish an exchange with no peer synchronously - #26699
Conversation
fac14b6 to
bf63d30
Compare
gnodet-bot
left a comment
There was a problem hiding this comment.
Backport of #26541 onto camel-4.22.x. The fix is correct.
The bug: process() called callback.done(true) (synchronous completion) but then fell through to return false (claiming async). The exchange would be "finished" by a write handler that never runs — a clear AsyncProcessor contract violation that could leave callers stuck or corrupt routing state.
The fix: Reorder VertxWebsocketResultHandler construction after the empty-peers check, add return true in the empty branch, and demote that log to DEBUG (ordinary broadcast state) while promoting the unmatched-key path to WARN (misconfiguration). All three changes are correct and consistent.
Tests:
VertxWebsocketProducerNoPeerTest— unit tests that directly assert the return value, single-callback invariant, anddoneSyncflag. The PR description confirms these tests actually caught the regression with the original code.VertxWebsocketTest.sendWithAnUnmatchedConnectionKeyDeliversToNobody— integration test verifying that an unmatched connection key delivers to nobody (and doesn't silently fan out to connected peers).
One cosmetic note: anExchangeWithNoBodyIsDoneSynchronously lives in VertxWebsocketProducerNoPeerTest but exercises the null-body early return at the top of process(), not the no-peer path. The test is correct — just slightly mishoused. Not a blocker.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
b07ae89 to
770a7bc
Compare
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after force-push (rebase-only — same tree as previous commit).
The content is identical to the prior push: the fix and tests are correct, as noted in the previous review. Confirming APPROVE.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
3e86d3f to
4e7a2e9
Compare
94fb200 to
5ab3179
Compare
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after latest push (commit 5ab3179).
The backport carries the same correct fix from #26541:
AsyncProcessorcontract:callback.done(true)in the empty-peers branch now pairs withreturn true, andVertxWebsocketResultHandlerconstruction is correctly moved after the guard. No more sync/async mismatch.- Log levels: empty-peers → DEBUG (ordinary broadcast state), unmatched key → WARN (misconfiguration). Both are correct and distinct conditions.
- Tests:
VertxWebsocketProducerNoPeerTestdirectly asserts theprocess()return value, single-callback invariant, anddoneSyncflag — these would have caught the original bug. The integration test verifies unmatched keys deliver to nobody without silently fanning out.
Static analysis (ast-grep): one pre-existing broad-exception-catch on line 106 — unchanged from prior reviews, not introduced by this PR.
Confirming APPROVE.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
5690dd9 to
e43c5bc
Compare
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after latest push (commit 7496264).
The backport carries the same correct fix from #26541 — rebased onto the current camel-4.22.x tip, no content changes:
AsyncProcessorcontract:callback.done(true)in the empty-peers branch now pairs withreturn true, andVertxWebsocketResultHandlerconstruction is correctly moved after the guard. No more sync/async mismatch.- Log levels: empty-peers → DEBUG (ordinary broadcast state), unmatched key → WARN (misconfiguration). Both conditions are distinct and correctly categorised.
- Tests:
VertxWebsocketProducerNoPeerTestdirectly asserts theprocess()return value, single-callback invariant, anddoneSyncflag.sendWithAnUnmatchedConnectionKeyDeliversToNobodyverifies that an unmatched key delivers to nobody without silently fanning out to connected peers.
Static analysis (ast-grep): one pre-existing broad-exception-catch at line 106 — unchanged from prior reviews, not introduced by this PR.
Confirming APPROVE.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after latest push (commit 7334a48).
Rebase-only force-push onto the current camel-4.22.x tip — same tree content as the previous commit (7496264). The fix and tests carry over unchanged:
AsyncProcessorcontract:callback.done(true)in the empty-peers branch correctly pairs withreturn true, andVertxWebsocketResultHandlerconstruction remains after the guard. No sync/async mismatch.- Log levels: empty-peers → DEBUG (ordinary broadcast state), unmatched key → WARN (misconfiguration). Both conditions are distinct and correctly categorised.
- Tests:
VertxWebsocketProducerNoPeerTestdirectly asserts theprocess()return value, single-callback invariant, anddoneSyncflag.sendWithAnUnmatchedConnectionKeyDeliversToNobodyverifies unmatched keys deliver to nobody without silently fanning out to connected peers.
Static analysis (ast-grep): one pre-existing broad-exception-catch at line 106 — unchanged from prior reviews, not introduced by this PR.
Confirming APPROVE.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after latest push (commit 233eb3c).
Rebase-only force-push onto the current camel-4.22.x tip — same tree content as the previous commit (7334a48). The fix and tests carry over unchanged:
AsyncProcessorcontract:callback.done(true)in the empty-peers branch correctly pairs withreturn true, andVertxWebsocketResultHandlerconstruction remains after the guard. No sync/async mismatch.- Log levels: empty-peers → DEBUG (ordinary broadcast state), unmatched key → WARN (misconfiguration). Both conditions are distinct and correctly categorised.
- Tests:
VertxWebsocketProducerNoPeerTestdirectly asserts theprocess()return value, single-callback invariant, anddoneSyncflag.sendWithAnUnmatchedConnectionKeyDeliversToNobodyverifies unmatched keys deliver to nobody without silently fanning out to connected peers.
Static analysis (ast-grep): one pre-existing broad-exception-catch at line 106 — unchanged from prior reviews, not introduced by this PR.
Confirming APPROVE.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
…n exchange with no peer synchronously
|
this is breaking compilation. as we can see in the PR check job and now on jenkins I do not find a revert button in the github UI, I will do it locally |
Backport of #26541
Cherry-pick of #26541 onto
camel-4.22.x.Original PR: #26541 - CAMEL-24789: camel-vertx-websocket - finish an exchange with no peer synchronously
Original author: @oscerd
Target branch:
camel-4.22.x