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

   # Description
   
   [CAMEL-24948](https://issues.apache.org/jira/browse/CAMEL-24948)
   
   `SedaProducer` swallowed `InterruptedException` (it re-set the flag and 
carried on) in three places: `put` with `blockWhenFull`, `offer` with 
`offerTimeout`, and the reply wait with `timeout <= 0`. The caller was then 
told the send succeeded: an InOnly message that was never queued was lost, and 
an InOut caller got its own request back as the reply. Camel interrupts these 
threads itself when a forced route stop shuts the pool down with `shutdownNow`, 
so this isn't only about user code interrupting threads (cf. CAMEL-22390).
   
   This change: keep re-setting the interrupt flag, but fail the exchange:
   - An interrupted `put` or `offer` throws 
`RejectedExecutionException("Interrupted while adding the exchange to the 
queue")`, with the `InterruptedException` as cause, like the existing "Queue 
full" failures.
   - An interrupted reply wait with `timeout <= 0` sets the 
`InterruptedException` on the exchange, removes the copy from the queue, and 
makes a later reply be ignored.
   
   The upgrade guide notes the change.
   
   Tests: new `SedaProducerInterruptedTest` (3 tests). Without the fix, the 
exception is null in all 3. `*Seda*`: 168 tests, 0 failures (2 pre-existing 
skips).
   
   Note: see #PR_30 (CAMEL-24947). Once both are merged, the interrupted wait 
here must use that PR's compare-and-set; I'll send the small follow-up.
   
   Found with a TLA+ model of SedaProducer, then reproduced against the real 
classes.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built and tested the affected modules, including the formatter and 
import-sort plugins. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   


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