-
Notifications
You must be signed in to change notification settings - Fork 38
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
Run Limits Responses in Thread to Prevent Blocking Decom #1901
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1901 +/- ##
==========================================
+ Coverage 79.42% 79.56% +0.14%
==========================================
Files 523 523
Lines 40926 41040 +114
==========================================
+ Hits 32506 32654 +148
+ Misses 8420 8386 -34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
self.logger.error(f"Called with old_state = {old_limits_state}, new_state = {item.limits.state}") | ||
self.logger.error(repr(error)) | ||
copied_packet = packet.deep_copy() | ||
copied_item = packet.items[item.name] |
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 just a reference right? Should it be a copy()
?
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.
Because of the packet.deep_copy it is a reference to the correct new item.
self.logger.error(f"{packet.target_name} {packet.packet_name} {item.name} Limits Response Exception!") | ||
self.logger.error(f"Called with old_state = {old_limits_state}, new_state = {item.limits.state}") | ||
self.logger.error(repr(error)) | ||
copied_packet = packet.deep_copy() |
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.
Python already has deepcopy
: https://docs.python.org/3/library/copy.html#copy.deepcopy. Should this just be packet.deepcopy
?
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.
No. Its a "mostly" deep copy. At least in Ruby can't do a real deep copy because that would marshal Mutex which isn't allowed.
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.
No unit tests?
Would love for someone else to add new unit tests if necessary. ;) |
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.
Now with unit tests!
|
No description provided.