-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: MetaGrpcClient deadlock when drop
Move the reference to the dedicated runtime `rt` from `MetaGrpcClient` to `ClientHandle`. `rt` is a reference to the dedicated runtime for running `MetaGrpcClient`. If all ClientHandle are dropped, the runtime will be destroyed. This `rt` previously is stored in `MetaGrpcClient`, which leads to a deadlock: - When all `ClientHandle` are dropped, the two workers `worker_loop()` and `auto_sync_interval()` will quit. - These two futures both held a reference to `MetaGrpcClient`. - The last of these(say, `F`) two will drop `MetaGrpcClient.rt` and `Runtime::_dropper` will block waiting for the runtime to shut down. - But `F` is still held, deadlock occurs. Other changes: - `Runtime::try_spawn` and several other spawn methods now accept a name argument for display in async backtrace. - Add async-backtrace to `MetaGrpcClient` methods
- Loading branch information
1 parent
00393c6
commit 939bdaa
Showing
12 changed files
with
329 additions
and
199 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.