-
Notifications
You must be signed in to change notification settings - Fork 179
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(api): Keep command keys stable across boots #12581
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #12581 +/- ##
=======================================
Coverage 73.59% 73.59%
=======================================
Files 2267 2267
Lines 62341 62341
Branches 6592 6592
=======================================
Hits 45881 45881
Misses 14886 14886
Partials 1574 1574
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Ah, yup. If we want there's a magic env var you can set to fix the per-proc hash seed but... they do this basically exclusively to cause this issue and I think it's a good thing, so doing our own hashing is a good call.
Do we use hash()
anywhere else?
Oh @SyntaxColoring if you want to test this exact behavior you could write a little script that calls this code and then run it with a python subprocess twice and check the outputs |
It looks like we have a few places, but they look legitimate: using |
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! thank you!
I was hoping this would work with a pair of It's probably possible to get test coverage with something like what you said, where we explicitly start a Python subprocess ourselves. From a call with @TamarZanzouri and @jbleon95, we don't think that's worth it at the moment, though. |
Overview
Fixes RSS-215. See that ticket for details.
Test Plan
I've reproduced the original problem on an OT-3, and run this branch on an OT-3 and confirmed that it fixes it.
Changelog
hash()
function to compute Protocol Engine commandkey
s, because it changes across runs of the Python interpreter. Instead, compute the hash "manually" withhashlib.md5
.Review requests
Risk assessment
Low.