-
Notifications
You must be signed in to change notification settings - Fork 141
Deduplicate route status entries #4250
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4250 +/- ##
==========================================
+ Coverage 86.11% 86.13% +0.01%
==========================================
Files 131 131
Lines 14205 14217 +12
Branches 35 35
==========================================
+ Hits 12233 12246 +13
+ Misses 1768 1767 -1
Partials 204 204 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
i would suggest to add some unit tests to check that deduplication works |
ciarams87
left a 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.
I didn't notice the failing unit test earlier - lgtm once that's fixed 😄
|
@tataruty Good suggestion, I did explore doing that, but the issue I found is that this is not easily reproducible. I never could figure out how the slice gets accessed in multiple places at once (it baffles me because each time this function is called should be a new entry). When running the benchmark test, out of 1000 route creations, this issue may pop up only once. |
Problem: Due to a shared slice pointer, in certain scenarios we could get entries in the status list that don't belong there, and result in duplicate entries when writing the status to the route. Solution: Copy the previous value before adding new entries, to avoid the shared slice.
2bcf93c to
66cc800
Compare
Problem: Due to a shared slice pointer, in certain scenarios we could get entries in the status list that don't belong there, and result in duplicate entries when writing the status to the route.
Solution: Copy the previous value before adding new entries, to avoid the shared slice.
Testing: Ran the benchmarking test and no longer saw the issue.
Closes #4249
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.