-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcrdtest: avoid concurrent exec.Cmd.Wait calls
exec.Cmd.Wait is not safe to call concurrently. Instead, call this method only once, in the goroutine started by node.start() used for abnormal process exit. After Wait exits, assign the error and close a new cmdDone channel added to the node struct. This allows node.stop() to detect when process shutdown has occurred, and provides access to the error so it can be logged. Since some other parts of node.stop() were racy on reading node.cmd, and it was unclear how it was intended to handle the difference between a node that was never successfully started and one that was previously stopped, another new channel cmdStarted is added to node to distinguish these conditions.
- Loading branch information
Showing
1 changed file
with
34 additions
and
18 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