gnodet commented on PR #31136:
URL: https://github.com/apache/camel/pull/31136#issuecomment-7287544912
Thank you for the thorough analysis, @oscerd — you are right on all counts.
**The test passes on `main` without the production change.** I looked at the
structure of `doRun()` after CAMEL-27515 landed:
```
while (...) {
try {
// ...
try {
processPolledExchange(exchange); // inner try
} catch (Exception e) { ... }
} catch (InterruptedException e) { ... }
catch (VirtualMachineError e) { handleFatalError; } // outer, inside
the while
catch (Throwable e) { exceptionHandler; } // outer, inside
the while — loop continues
}
```
An `AssertionError` from `processPolledExchange` escapes the inner `catch
(Exception)`, is caught by the outer `catch (Throwable)` **which is inside the
while loop**, and the loop continues. So `testConsumerSurvivesNonFatalError`
would indeed pass without this change on current `main`.
**What was true when I wrote this PR:** CAMEL-27515 landed on Nov 25, 2026 —
after CAMEL-27471 was filed but while this fix was in progress. At that time
(before CAMEL-27515), the outer catch was just `catch (Exception e)`, and any
`Error` escaping the inner `catch` would propagate out of the `while` loop
entirely, killing the consumer thread permanently. That was the actual bug.
**Current status:** This PR is a **defensiveness refactor** on current
`main`. The inner `catch (Error)` at the call site makes the intent explicit
and handles `Error` closer to where it arises, but the outer `catch
(Throwable)` already covers the synchronous path with the same effect.
I will update the PR description and the test Javadoc to accurately reflect
this — removing the claim that the test fails on `main` without the fix, and
framing the change as defensive, explicit handling rather than a behavior fix.
If you feel the change is not worth merging as a pure style/defense
refactor, I'll close it. Otherwise I'll update the description and the test
comment.
_Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
--
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]