Skip to content
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 Fanout thread safety #47736

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Fix Fanout thread safety #47736

merged 1 commit into from
Mar 28, 2023

Conversation

tenderlove
Copy link
Member

Fanout is a singleton shared among threads, so all of its hash maps should be concurrent hash maps otherwise we'll see errors like this:

RuntimeError: can't add a new key into hash during iteration

cc @zenspider

Fanout is a singleton shared among threads, so all of its hash maps
should be concurrent hash maps otherwise we'll see errors like this:

```
RuntimeError: can't add a new key into hash during iteration
```
@tenderlove
Copy link
Member Author

@zenspider if this fixes your production issues please lmk!

@skipkayhil
Copy link
Member

Should this use compute_if_absent like #46536 ?

@zenspider
Copy link
Contributor

We're deploying our monkeypatch to prod now... I'll let you know.

@zenspider
Copy link
Contributor

Confirmed!

@zzak zzak added the ready PRs ready to merge label Mar 28, 2023
@rafaelfranca rafaelfranca merged commit 689fafa into main Mar 28, 2023
@rafaelfranca rafaelfranca deleted the thread-safety branch March 28, 2023 17:37
@dentarg
Copy link

dentarg commented Jul 18, 2023

Should this use compute_if_absent like #46536 ?

Yeah, shouldn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activesupport ready PRs ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants