Skip to content

propagate scope in async failures #3950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.3.x
Choose a base branch
from

Conversation

igormq
Copy link

@igormq igormq commented Jun 7, 2025

I still can’t reproduce the issue locally (possibly due to the use of embedded Kafka, so tests are passing for both scenarios), but applying the fix in our codebase confirms that it resolves the underlying problem.

When async returns are enabled and a failure occurs, the Kafka sender loses the original consumer’s trace context. As a result, a new trace is started, causing messages that arrive in the retry or DLT topics to have a different trace ID from the original.

Can you help me understand how to test it correctly?

P.S.: I tested over the 3.3.6 branch so I could test the jar in my project.

@igormq igormq changed the base branch from main to 3.3.x June 7, 2025 09:38
acknowledge(acknowledgment);
if (canAsyncRetry(request, ex) && this.asyncRetryCallback != null) {
@SuppressWarnings("unchecked")
ConsumerRecord<K, V> record = (ConsumerRecord<K, V>) request;
this.asyncRetryCallback.accept(record, (RuntimeException) ex);
} else {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

annoying receiving this error if we can recover from that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant