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

Synchronize the upstream/downstream batch processor code #251

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Sep 24, 2024

As I prepare to submit the concurrent batch processor code to the upstream repository, I have developed the following proof-of-concept:

https://github.com/open-telemetry/opentelemetry-collector/pull/11248/files

I simplified, commented, linted, and tidied the code in that repository, aiming to achieve the smallest diff possible w/ only the essential features of this repository contributed back. This incorporates upstream changes in metadata.yaml, metrics code generation, and related lint improvements. Then, I copied the changed files back here.

No functional changes. I have eliminated the in-flight bytes metric and the panic recovery feature, both nice-to-have but complicates the diff and appear unnecessary.

Includes the upstream README.md, metadata.yaml, and generated code.

@jmacd jmacd merged commit b0b176d into open-telemetry:main Sep 25, 2024
2 checks passed
@jmacd jmacd deleted the jmacd/sync_upstream branch September 25, 2024 15:41
@jmacd jmacd mentioned this pull request Sep 25, 2024
jmacd added a commit that referenced this pull request Sep 26, 2024
- Concurrent batch processor: concurrency limit for legacy behavior or
otherwise. [#254](#254)
- Concurrent batch processor: EarlyReturn legacy compat feature.
[#253](#253)
- Concurrent batch processor: Synchronize with upstream; removes
in-flight bytes metric,
removes panic recovery as unnecessary divergence.
[#251](#251)
- Update collector dependencies to v0.110.0/v1.16.0; remove validation
connector [#252](#252)
jmacd added a commit that referenced this pull request Oct 1, 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.
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