Skip to content
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

(concurrentbatchprocessor): Fix deadlock, test EarlyReturn feature #257

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Sep 30, 2024

This tests and fixes a deadlock in the concurrent batch processor, one that was especially easy to see with EarlyReturn=true, however exists either way. The bug was introduced in #251 when it removed a defer func() from consumeAndWait() by mistake.

This is now covered by testing. This is fixed w/o a defer func() { ... }. The older code was both counting responses and updating a semaphore. Now that we only count responses and do not update a semaphore, there is no need to defer. The batcher will avoid sending to the waiter when the waiter's context is canceled.

@jmacd jmacd changed the title Test EarlyReturn feature (concurrentbatchprocessor): Fix deadlock, test EarlyReturn feature Sep 30, 2024
Copy link
Contributor

@lquerel lquerel left a comment

Choose a reason for hiding this comment

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

LGTM

@jmacd jmacd merged commit 58c3bdf into open-telemetry:main Oct 1, 2024
2 checks passed
@jmacd jmacd mentioned this pull request Oct 9, 2024
jmacd added a commit that referenced this pull request Oct 9, 2024
Release the fix in #257.
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.

2 participants