davsclaus opened a new pull request, #29552:
URL: https://github.com/apache/camel/pull/29552

   [CAMEL-26797](https://issues.apache.org/jira/browse/CAMEL-26797): this was 
found by `camel cmd chaos-explore` (CAMEL-26760) on the chaos example 
(apache/camel-jbang-examples#134). That example adds a refunds route which 
calls the payment service over HTTP.
   
   The model wrote `expect=refunds->payment:lost<=0` for "refunds handles a 503 
from payment". The experiment **passed while 7 refunds failed**, for three 
reasons:
   
   - `a->b:lost` counts what route a completed and route b did not 
(CAMEL-26726). That means something only for a hand-off, such as orders handing 
off to shipping over seda.
   - Refunds calls payment and waits for it, so a 503 fails the refund in 
refunds. A failed exchange is not counted by `lost`.
   - Payment also answered the orders (13 completed in refunds, 57 in payment), 
so the expectation was 0 lost by construction.
   
   The playbook already says to use `->lost` only for the hand-offs the 
suggestions name, but a small model does not always follow it. So, as with the 
checks of CAMEL-26790, camel-chaos catches it and says why:
   
   - **A warning when the rule is added.** It applies to `a->b:lost` when route 
a does not hand messages off to route b. `ChaosAdvisor.lostWithoutHandOff` 
walks the static sends from route a to the routes that consume them. If b is 
never reached, the warning says "refunds does not hand messages to payment 
(over seda, a broker or a wireTap)". If b is reached only by `direct` calls, it 
says "checkout calls payment over direct and waits for it". Both name 
`expect=<a>:failed<=0`. A route with a send that is known only when it sends 
(`toD`, `wireTap`, `recipientList`) is not checked, to avoid a false warning. 
`chaos-add`, `chaos-change` and the experiment tools pass the warning on, as 
for the dead letter channel warning.
   - **An experiment does not pass while the route of its expectation failed 
exchanges that no expectation counts.** These count failures: `failed`, 
`completed` (a failure is not completed), and the second route of `lost`. Such 
an experiment is `INCONCLUSIVE`, with the reason "route refunds failed 7 
exchanges that its expectations do not count, so they say nothing about the 
failures: expect=refunds:failed<=0 counts them". This reason comes before "it 
ended before an expectation was decided", since waiting longer would not count 
the failures. Failures of routes outside the expectations stay in `alsoFailed` 
only, as before.
   
   Tests are in `ChaosExperimentTest`:
   - three kinds of route pair: an HTTP-like call, a `direct` call, and a seda 
hand-off, which gets no warning;
   - the refunds case with payment fed by other callers, which is now 
INCONCLUSIVE;
   - an expectation that counts the failures, which decides FAIL.
   
   All camel-chaos tests pass. The `chaos.adoc` docs and their catalog copy are 
updated.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


-- 
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]

Reply via email to