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

fix crash when executor parent nomad process dies #5598

Merged
merged 1 commit into from
Apr 23, 2019

Commits on Apr 23, 2019

  1. fix crash when executor parent nomad process dies

    Fixes #5593
    
    Executor seems to die unexpectedly after nomad agent dies or is
    restarted.  The crash seems to occur at the first log message after
    the nomad agent dies.
    
    To ease debugging we forward executor log messages to executor.log as
    well as to Stderr.  `go-plugin` sets up plugins with Stderr pointing to
    a pipe being read by plugin client, the nomad agent in our case[1].
    When the nomad agent dies, the pipe is closed, and any subsequent
    executor logs fail with ErrClosedPipe and SIGPIPE signal.  SIGPIPE
    results into executor process dying.
    
    I considered adding a handler to ignore SIGPIPE, but hc-log library
    currently panics when logging write operation fails[2]
    
    This we opt to revert to v0.8 behavior of exclusively writing logs to
    executor.log, while we investigate alternative options.
    
    [1] https://github.com/hashicorp/nomad/blob/v0.9.0/vendor/github.com/hashicorp/go-plugin/client.go#L528-L535
    [2] https://github.com/hashicorp/nomad/blob/v0.9.0/vendor/github.com/hashicorp/go-hclog/int.go#L320-L323
    Mahmood Ali committed Apr 23, 2019
    Configuration menu
    Copy the full SHA
    c07c0c8 View commit details
    Browse the repository at this point in the history