-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix race condition in init context (#238)
There is still a race condition on the init context. This occurs only in the event of a timeout. The goroutine actually continues executing, except we just unblock the main process (similar to js promise.race). So there is a race condition when writing to `context.Error` (1. in the timeout handler, 2. during `client.init`) To solve, use a mutex lock and clone to context. (Cloning is necessary because even if we use a mutex lock, there is no guarantee that "Timed out" will be the final error set)
- Loading branch information
1 parent
7919428
commit 66d7d48
Showing
3 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
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