-
Notifications
You must be signed in to change notification settings - Fork 792
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
3137 multiprocessing safe api client #3219
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## develop #3219 +/- ##
===========================================
- Coverage 73.08% 73.08% -0.01%
===========================================
Files 467 467
Lines 13655 13662 +7
===========================================
+ Hits 9980 9985 +5
- Misses 3675 3677 +2 see 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
This is a simpler solution than I was expecting, though I'm sure it took a lot of reading, as well as trial and error to arrive at it. Good work.
It might be worth squashing these commits down into 1. Your call.
The only thing I can think of that's missing is a lock in handle_authentication_token_expiration()
. HTTPIslandAPIClient
should accept a common.types.Lock
, so it can remain ignorant of multiprocessing vs threading.
Note: Using |
0ab2b54
to
fdf2658
Compare
self, | ||
agent_event_serializer_registry: AgentEventSerializerRegistry, | ||
agent_id: AgentID, | ||
lock: BasicLock, |
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.
Consider narrowing this to Lock
. Since RLock
is a BasicLock
, this would accept an RLock
, but we don't really know what the implications of that would be.
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'm still leaning toward BasicLock
, since multiprocessing.Lock
doesn't adhere to the Lock
protocol. multiprocessing.Lock
and multiprocessing.RLock
have the same interface
What does this PR do?
Fixes part of #3137 by making IIslandAPIClient usage process-safe by using a proxy object.
PR Checklist
Testing Checklist