Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deadlock fix in acquireShards (#5825)
Fixing the deadlock demonstrated in #5824. I decided to move the channel-writing entirely before consuming so it's a bit more accidental-change-resistant: some kinds of simple incorrect changes will lead to an _immediate_ deadlock every time, rather than a random chance of one. And if someone _does_ want to move it after and go back to a smaller buffer, more code will have to be changed, so hopefully people will pay more attention to the concurrency risks involved. More generally, the atomic shutdown stuff is _highly_ prone to causing this kind of error because there's no way to wait on it safely, and I would really love for us to get rid of it.
- Loading branch information