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

   # Description
   
   [CAMEL-24950](https://issues.apache.org/jira/browse/CAMEL-24950)
   
   `SedaEndpoint.purgeQueue()` was `queue.clear()`. It dropped request/reply 
exchanges without completing them, so their producers kept waiting: the full 
timeout, or forever with `timeout=0`. It also blocked graceful shutdown of the 
producer's route while that exchange stayed inflight.
   
   This change: purging drains the queue, fails each discarded exchange with 
`RejectedExecutionException("Exchange discarded as the SEDA queue was 
purged")`, and runs its on-completions, as `SedaConsumer` does after a 
multicast. Waiting producers are released with that exception.
   
   Behaviour change, noted in the upgrade guide: on-completions handed over to 
a discarded InOnly exchange (for example a file consumer's rollback) now run as 
a failure, on the thread doing the purge. Before, they never ran.
   
   Tests: new `SedaPurgeWhenStoppingWaitingProducerTest` (2 tests): a stop with 
`purgeWhenStopping`, and a JMX-style `purgeQueue()`. Without the fix: 
`TimeoutException` (the producer is still blocked), and the InOnly completion 
never runs. Seda suites: 153 tests, plus 4 JMX tests, 0 failures.
   
   Found with a TLA+ model of SEDA purge, 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