Skip to content

CAMEL-23513: Fix completeAllOnStop() not completing aggregations with completionInterval()#23235

Merged
gnodet merged 2 commits into
apache:mainfrom
gnodet:CAMEL-23513-completeAllOnStop-interval-fix
May 14, 2026
Merged

CAMEL-23513: Fix completeAllOnStop() not completing aggregations with completionInterval()#23235
gnodet merged 2 commits into
apache:mainfrom
gnodet:CAMEL-23513-completeAllOnStop-interval-fix

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 14, 2026

CAMEL-23513

Summary

  • Fix completeAllOnStop() not reliably completing in-flight aggregations when used with completionInterval()
  • AggregateProcessor.prepareShutdown() now also force-completes all groups when completeAllOnStop is set, not just when forceCompletionOnStop is set
  • Fix the flaky testCompleteAllOnStopWithCompletionIntervalOnly test by addressing the underlying race, and update it to use a 60-second interval so it deterministically validates force completion rather than relying on the interval timer to race against shutdown

Root Cause

prepareShutdown() only checked forceCompletionOnStop to trigger doForceCompletionOnStop(). With completeAllOnStop, the shutdown relied on the AggregationIntervalTask firing during the shutdown window — a race condition that caused the AggregateCompleteAllOnStopWithIntervalTest to fail intermittently.

Test plan

  • AggregateCompleteAllOnStopWithIntervalTest passes deterministically (20/20 runs)
  • Full aggregator test suite (org.apache.camel.processor.aggregator.*) passes with no regressions

… completionInterval()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet requested review from Croway and davsclaus May 14, 2026 19:18
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the core label May 14, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • core/camel-core-processor
  • core/camel-core

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • core/camel-core: 2 test(s) disabled on GitHub Actions
Build reactor — dependencies compiled but only changed modules were tested (2 modules)
  • Camel :: Core
  • Camel :: Core Processor

⚙️ View full build and test results

@gnodet gnodet merged commit 507fb2b into apache:main May 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants