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.
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
usm: map cleaner: Use batch operations #20907
usm: map cleaner: Use batch operations #20907
Changes from 7 commits
5d65920
b183c3c
cda7597
362a1c2
34bbebb
d4daa5a
1d5103f
608e2f5
33713af
643c00c
1e99e6a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Please re-add the comment (not necessarily here) as this is still relevant. You're still passing a
unsafe.Pointer
toMapIterator.Next()
.The reason why this was done originally was to avoid the marshalling cost as noted in the comment.
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.
nit/suggestion: let's try to be more strict with the type constraints here. For example, we don't want pointers, interfaces etc since this would cause issues with the code downstream.
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.
Tried to look for a way of doing that, but couldn't find such a way (to exclude interface / pointer)
if you have a way - I'd be happy to learn
having said that - we still have a guard - UTs
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.
it's really nice to see a bunch of hacks go away now that we have generics :)
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.
Also, the use of generics introduced improvement, as we don't need marshalBytes!
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.
Do we really want to execute this in a loop? I think it's not that unlikely that in a real-world workload this could run forever which would cause the
MapCleaner
to hang during termination, no?In this pathological scenario you would supply also a stale timestamp to the callback
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.
Not sure about running forever / adding timed context here
but instead, we can "halt" if we processed
mc.emap.MaxEntries
what do you think about that?
Along side with aborting the loop when we got 0 entries from the batch api, it will guarantee we won't be stuck forever
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.
sounds reasonable to me 👍