apupier commented on code in PR #26798:
URL: https://github.com/apache/camel/pull/26798#discussion_r4094185755
##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/ThreadPerTaskSedaConsumer.java:
##########
@@ -128,9 +128,24 @@ protected void afterPollEmpty() {
@Override
protected void processPolledExchange(Exchange exchange) {
+ // count the task when it is dispatched (not when it starts running),
so a graceful shutdown
+ // also waits for polled exchanges whose task has not started yet
+ activeTasks.increment();
+ try {
+ dispatch(exchange);
+ } catch (RuntimeException e) {
+ // the task was not dispatched (e.g. rejected)
+ activeTasks.decrement();
Review Comment:
shouldn't the decrement be safer if done in a finally block?
--
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]