[ 
https://issues.apache.org/jira/browse/CAMEL-26966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-26966:
--------------------------------
    Fix Version/s: 4.24.0

> camel-sanitizer - rule R3a: process returns the value its callback is called 
> with
> ---------------------------------------------------------------------------------
>
>                 Key: CAMEL-26966
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26966
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: shashank
>            Assignee: shashank
>            Priority: Major
>             Fix For: 4.24.0
>
>
> Step 4 of the order of work in the exchange sanitizer design 
> ({{design/exchange-sanitizer.adoc}}, CAMEL-26630), first part: the 
> {{AsyncProcessor}} contract of rule R3 (one thread at a time) in 
> {{camel-sanitizer}}, after R1 (CAMEL-26714) and R2 (CAMEL-26768). The second 
> part of R3, the sampled watch windows, comes later.
> *The rule* (as the Javadoc of {{AsyncProcessor}} states it): the value the 
> callback of a call is called with ({{doneSync}}) is the value 
> {{process(exchange, callback)}} returns. A caller that uses the return value 
> continues the exchange on {{true}} and leaves it to the callback on 
> {{false}}, so a processor that returns the other value lets two threads 
> continue the exchange, or none.
> *What R3a reports* (new kinds of {{Violation}}, rule R3), at the call of each 
> step below its error handler:
> * {{RETURNED_TRUE_CALLBACK_FALSE}}: process returned true while its callback 
> was called with false on another thread (such as a processor that waits for 
> its worker).
> * {{RETURNED_TRUE_BEFORE_CALLBACK}}: process returned true, and the callback 
> came later on another thread, or with true.
> * {{RETURNED_FALSE_CALLBACK_TRUE}}: process returned false and the callback 
> was called with true.
> *Narrowed* for the one case the Javadoc allows: a processor that hands its 
> callback to the reactive executor returns the value of the processor it 
> calls, and the reactive executor calls the callback with false on the calling 
> thread (every step that sends to a {{direct}} endpoint sees this). A callback 
> with false on the calling thread is never reported. The design text says so.
> *How*
> * A second {{StepListener}} with a small record per call (no table, no 
> exchange); a stack only for a callback on another thread before the return, 
> or for a report.
> * {{camel.sanitizer.checks}} gets {{threads}}; the default becomes 
> {{callback,threads}} ({{callback,commit,threads}} in a test). camel-main 
> option, docs, and the dev console and {{camel get sanitizer}} show R3 and the 
> checks that run.
> *Validation* (in the PR): user processors that break each case must fail 
> their test with a report that names the step and class; correct async 
> processors and the core EIPs that go on other threads must stay quiet; the 
> camel-core suite with {{-Psanitizer}} is run in full, and any R3 report from 
> Camel's own code is listed as a finding (its own JIRA, or the rule narrowed 
> with the reason written down).
> _Filed with Claude Code on behalf of allthingssecurity._



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to