Skip to content

CAMEL-23692: BacklogTracer captures late-arriving async branch events#23775

Merged
davsclaus merged 2 commits into
mainfrom
fix/CAMEL-23692
Jun 5, 2026
Merged

CAMEL-23692: BacklogTracer captures late-arriving async branch events#23775
davsclaus merged 2 commits into
mainfrom
fix/CAMEL-23692

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • Fix BacklogTracer dropping trace events from async downstream routes (e.g., second branch of a multicast via Kafka/SEDA) when a new exchange claims the provisional history queue before the async branch finishes
  • Add fallback clause that appends late events matching lastCompletedBreadcrumbId directly to completeHistoryQueue
  • Add test BacklogTracerMessageHistoryMulticastSedaTest that reproduces the race condition

Test plan

  • All 17 BacklogTracer* tests pass (no regressions)
  • New test verifies multicast to two seda endpoints with delayed branch — all three routes appear in message history
  • Manual verification with TUI History tab on a multi-route example using async endpoints

Claude Code on behalf of Claus Ibsen

🤖 Generated with Claude Code

When a multicast sends to multiple async endpoints (e.g. Kafka/SEDA),
the second branch may fire its trace events after a new exchange has
already claimed the provisional history queue. These late events were
silently dropped because they matched neither the new exchange nor the
append-mode conditions.

Add a fallback clause that appends events matching
lastCompletedBreadcrumbId directly to completeHistoryQueue, ensuring
all async branches appear in the message history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

🌟 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 Jun 5, 2026
The previous test sent two exchanges to trigger the race condition but
this caused the second exchange to clear completeHistoryQueue, making
assertions unreliable in CI. A single exchange with multicast to two
seda endpoints (one delayed) is sufficient to verify that both async
branches appear in the message history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus davsclaus merged commit 2a025f2 into main Jun 5, 2026
3 of 9 checks passed
@davsclaus davsclaus deleted the fix/CAMEL-23692 branch June 5, 2026 07:27
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.

1 participant