-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
(internal/otelarrow) Add new LIFO boundedqueue #36140
Conversation
The residual portion of #36033 is now drafted in #36141. It is a fairly small change. @andrzej-stencel let me know if this approach sounds good to you. For that PR to pass its tests, the contents of this PR would be merged first. Then, the old |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…tor-contrib into jmacd/newboundedqueue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few suggestions to potentially reduce contention on the lock.
…tor-contrib into jmacd/newboundedqueue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating the GH issue open-telemetry/otel-arrow#270 for tracking.
LGTM.
No changelog is needed, the next step #36141 where we use this code will have a user-relevant changelog. |
…tor-contrib into jmacd/newboundedqueue
…y-collector-contrib into jmacd/newboundedqueue
…tor-contrib into jmacd/newboundedqueue
Description
Adds a new LIFO-based bounded queue implementation for use by OTel-Arrow receiver admission control logic. This code is similar to but different than the existing bounded queue implementation. This code fixes a race condition discovered in the original package, which occurs when the admission is granted concurrently with context cancellation. This code is extracted from #36033, which demonstrates a final-state solution to #36074 and has been broken into parts to make reviews easier.
There are two substantial changes in this bounded queue implementation, although they appear similar. Because the differences between the old and new are relatively meaningless, and because the overall change is large, this PR proposes to add a new library of code that will not be used until a future PR.
The two substantial changes are:
In addition, this fixes a race in the FIFO queue: when a task is canceled concurrently with being admitted, the resource will leak.
Because the changes were so significant, I chose to start from scratch with testing. The replacement tests have 100% coverage and are fairly readable.
After this merges, the residual portion of #36033 will be a small change. In addition, by taking this approach we can close #36100 because #36033 will have been reduced to a small change that only replaces
waiter_limit
withwaiting_limit_mib
.Link to tracking issue
Part of #36074.
Testing
New tests have 100% coverage.
Documentation
README added.