-
Notifications
You must be signed in to change notification settings - Fork 224
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
Fix ring-buffer map consumer pointer on multiple subscribe/unsubscribe. #3002
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…for-windows into gtrevi/fix-rb-issue
gtrevi
changed the title
Fix ring-buffer map initialization.
Fix ring-buffer map consumer pointer on multiple subscribe/unsuscribe.
Oct 27, 2023
gtrevi
changed the title
Fix ring-buffer map consumer pointer on multiple subscribe/unsuscribe.
Fix ring-buffer map consumer pointer on multiple subscribe/unsubscribe.
Oct 27, 2023
gtrevi
requested review from
dthaler,
poornagmsft,
Alan-Jowett,
saxena-anurag,
shankarseal,
dv-msft,
shpalani,
matthewige,
mtfriesen and
rectified95
as code owners
October 31, 2023 00:54
Can you write a bit more in the PR description about the ring buffer map, where we use it in eBPF, why it was broken and how it's fixed now? |
matthewige
previously approved these changes
Oct 31, 2023
Alan-Jowett
previously approved these changes
Nov 1, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 1, 2023
dthaler
previously approved these changes
Nov 6, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 6, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 7, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 7, 2023
gtrevi
dismissed stale reviews from Alan-Jowett, matthewige, and dthaler
via
November 7, 2023 23:53
0b49a4f
shankarseal
approved these changes
Nov 8, 2023
shpalani
approved these changes
Nov 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3001
Description
This PR fixes an initialization issue of the consumer pointer of the ring-buffer map, in multiple subscribe/unsubscribe scenarios.
When subscribing for the first time, the
consumer_offset
pointer index starts at 0, then by design it only increments. The issue is when a client quits and subscribes again, ebpfcore will subtract its current consumer offset index from a smaller offset from the client's request, therefore causing an arithmetic exception inebpf_ring_buffer_map_return_buffer
when attempting to return data from the buffer.The fix now returns the actual consumer offset within the reply to each client subscription, so that the queries are in sync with the current ring-buffer's pointer.
Testing
Local, CI/CD
Documentation
n.a.