allthingssecurity commented on code in PR #30352: URL: https://github.com/apache/camel/pull/30352#discussion_r4626288921
########## components/camel-sanitizer/src/main/docs/sanitizer.adoc: ########## @@ -285,8 +288,60 @@ Exchange sanitizer: process returned true, and its callback was called on anothe Usual fix: when the work goes on another thread, return false from process and let that thread call the callback with false; return true only after the callback was called with true on the calling thread. ---- -The second part of R3, a short watch window at sampled points where a thread waits for another one that uses the same -exchange, is not in this version. +=== Accesses that overlap in time + +The second part of R3 looks for two threads that use the same exchange at the same time, as KCSAN does in the Linux +kernel. The routing engine uses an exchange at known points: a step is called, the callback of a step continues the +exchange, and an on completion runs. At a sample of these points the thread opens a short watch window on the exchange +and pauses in it. If another thread comes to a point of the same exchange during the window, both are reported. +Each report names the thread and its stack (`USED_BY_TWO_THREADS`). A thread that only waits, such as a caller that waits +for its task, is at no point, so it is not reported. The return of `process` is not a point: after an asynchronous +processor handed the exchange on, its caller only unwinds, while the thread that got the exchange may already call the +callback. An access between these points is not seen, such as an `AggregationStrategy` that runs on a thread of a pool, Review Comment: Split it into three sentences in 5e1a2dc (component doc and catalog copy, kept identical). _Claude Code on behalf of allthingssecurity_ -- 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]
