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

   ## What
   
   [CAMEL-26772](https://issues.apache.org/jira/browse/CAMEL-26772): `camel cmd 
chaos-suggest` offers pairs of faults to try together. Step 3 of 
[CAMEL-26760](https://issues.apache.org/jira/browse/CAMEL-26760) ("let there be 
chaos"). Decided with Claus: after the single faults, the combinations come 
from the suggestions, and the model of an agent picks from them. Most bugs that 
lose messages need two failures that meet (CAMEL-26734 was found that way, and 
the blog's "when the last safety net fails" is the first pair below).
   
   **Stacked on #29462** (CAMEL-26771, the feed hint). Retarget to `main` once 
#29462 merges.
   
   ```
   5. route orders: An outage while the dead letter channel fails (combined)
      route orders sends what fails to the dead letter channel direct:parked: 
when http://payment/charge is down for a minute and the dead letter channel 
fails too, are messages lost? The report counts what the dead letter channel 
did not take as lost
      camel cmd chaos-add --rule='endpoint=http://payment/charge error 
status=503 until=1m' --rule='endpoint=direct:parked error at=dlq until=1m'
   ```
   
   ## Changes
   
   - `ChaosAdvisor`: for the first remote call of a route (not a local file):
     - **An outage while the dead letter channel fails**, when the route has 
one: the call fails for a minute (`status=503` for HTTP, else a 
`ConnectException`), and the dead letter channel fails at the same time 
(`at=dlq`). The report already counts what the dead letter channel did not take 
as lost.
     - **A slow service that also fails**: `delay duration=1s..3s rate=0.5` and 
an error `rate=0.2` on the call, for two minutes; the why suggests an 
expectation such as `expect=<route>:maxTime<=30s`.
     - Both rank below the single faults (52 and 45).
   - `Suggestion` gets `with` (the other rules) and `rules()`; a new kind 
`combined`. Its rules count as their own kinds in what has been tried, so a 
pair is never "not tried yet" and never `tried`.
   - JSON: `rules` (all the rules to add together) on a pair, `rule` stays the 
first.
   - CLI: `camel cmd chaos-add --rule='…' --rule='…'`; footer of 
`chaos-suggest` mentions the pairs.
   - TUI (`w`): Enter types the rules of a pair in separated by `;`, which the 
add command splits.
   - AI (`chaos_suggest`) and MCP (`camel_runtime_chaos_suggest`) descriptions: 
pairs have `rules`, to add together with `;`.
   - Docs: the two pairs in the table of "What to try", an example, and `rules` 
in the JSON; catalog copy and golden help regenerated.
   
   ## Tests
   
   - `ChaosPairsTest` (new): both pairs with their rules and why, after the 
single faults, none for a route without a remote call, `rules` in the JSON and 
no `tried` for a pair while its rule tried on its own is, and `combined` never 
in what has been tried.
   - `ChaosAdvisorTest.everySuggestedRuleIsValid` checks each rule of a pair 
too.
   - `CamelChaosActionTest.suggestAddsTwoFaultsAtOnceTogether`, 
`ChaosControlTest.twoFaultsAtOnceAreTypedInTogether` (the add request has both 
rules).
   - Local runs, all passing: camel-chaos (814), camel-jbang-core 
`CamelChaos*Test` + `CliHelpGoldenTest` + `ToolRegistry*Test`, camel-jbang-mcp 
(542), TUI `Chaos*Test` (68).
   
   _Claude Code on behalf of Claus Ibsen_
   


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