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

   # Description
   
   [CAMEL-24951](https://issues.apache.org/jira/browse/CAMEL-24951)
   
   Stopping a suspended SEDA route, or the CamelContext, with queued messages 
always waited for the full shutdown timeout: 5002 ms instead of 490 ms with a 5 
s timeout, 45 s by default. A suspended consumer doesn't poll, but the shutdown 
strategy waited for its queue to drain, and its poll threads only exited on an 
empty queue. CAMEL-6390 fixed the empty-queue case. Routes suspended by a 
`RoutePolicy` (e.g. `ThrottlingInflightRoutePolicy`) end up in this state 
without any user action.
   
   This change:
   - A suspending or suspended `SedaConsumer` reports 0 pending, after the 
unchanged `purgeWhenStopping` purge.
   - Its suspended poll loop exits once a stop starts.
   
   The queued messages stay in the queue, or are purged with 
`purgeWhenStopping`, and are processed if the route starts again. The upgrade 
guide notes the change.
   
   Design point for reviewers: the alternative is to resume suspended consumers 
so they drain on stop. That would process messages on a route the user or a 
policy deliberately suspended. Today the stop also ends without draining, just 
after the timeout.
   
   Tests: new `SedaSuspendedRouteWithPendingStopTest` (2 tests): `stopRoute` 
with `abortAfterTimeout=true`, and `context.stop()`. Without the fix, 
`stopRoute` returns false and `context.stop` times out, each after the 10 s 
test timeout. Suites: 233 tests, 0 failures (2 pre-existing skips).
   
   Found with a TLA+ model of SEDA suspend/stop, 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