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

dcrdtest: avoid concurrent exec.Cmd.Wait calls #22

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Commits on Apr 4, 2024

  1. 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.
    jrick committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    841153e View commit details
    Browse the repository at this point in the history