-
Notifications
You must be signed in to change notification settings - Fork 78
Make the :sha256 set check resist race conditions #3180
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 ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3180 +/- ##
==========================================
- Coverage 97.34% 93.40% -3.95%
==========================================
Files 224 224
Lines 44836 44837 +1
==========================================
- Hits 43644 41878 -1766
- Misses 1192 2959 +1767
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@@ -183,8 +183,9 @@ async def initCoreModule(self): | |||
async def _hookFileBytesSha256(self, node, prop, norm): | |||
# this gets called post-norm and curv checks | |||
if node.ndef[1].startswith('sha256:'): |
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 seems like this check is redundant (and maybe slower? Is .startswith()
less performant than the f-string and comparison?). You could probably remove this line and outdent the three lines you added.
Just a suggestion, no change required.
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.
There are instances where the string starts with guid:
that we don't want to check for matching the norm'd fstring 👍
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 don't totally understand how this fixes the race but the change looks good to me.
No description provided.