-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Ensure change callback manipulation is threadsafe #12623
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
@@ Coverage Diff @@
## branch-3.1 #12623 +/- ##
===========================================
Coverage 92.16% 92.17%
===========================================
Files 313 313
Lines 19591 19595 +4
===========================================
+ Hits 18057 18061 +4
Misses 1534 1534 |
The `_change_callbacks` dictionary is being iterated over directly which means that when another thread removes or adds a callback we get `RuntimeError: dictionary changed size during iteration`. This PR simply makes a copy of the dictionary so we can iterate over it safely.
2b59905
to
df2ee9a
Compare
cc @philippjfr apologies for the rebase, some recent linter fixes needed to be brought in. Please take a look when you can, I'd like to include this in 3.0.3 I added tests for the new methods, but not that the
so this just preserves the status quo at least. |
768b7e1
to
47f0d6a
Compare
47f0d6a
to
14eaa5c
Compare
OK manual testing seems to be good, I am going to go ahead and merge to get into the backports PR. @philippjfr lmk if you have any concerns |
* Ensure change callback manipulation is threadsafe The `_change_callbacks` dictionary is being iterated over directly which means that when another thread removes or adds a callback we get `RuntimeError: dictionary changed size during iteration`. This PR simply makes a copy of the dictionary so we can iterate over it safely. * Also handle event callbacks * factor callback lookup into methods returning tuples Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
Thanks and sorry I didn't get around to add a test. |
* Ensure change callback manipulation is threadsafe The `_change_callbacks` dictionary is being iterated over directly which means that when another thread removes or adds a callback we get `RuntimeError: dictionary changed size during iteration`. This PR simply makes a copy of the dictionary so we can iterate over it safely. * Also handle event callbacks * factor callback lookup into methods returning tuples Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The
_change_callbacks
dictionary is being iterated over directly which means that when another thread removes or adds a callback we getRuntimeError: dictionary changed size during iteration
.Due to the nature of threading issues I don't have a good reproducer.