Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • N Nomad
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 小 白蛋
  • Nomad
  • Repository
Switch branch/tag
  • nomad
  • command
  • executor_plugin.go
Find file BlameHistoryPermalink
  • Mahmood Ali's avatar
    fix crash when executor parent nomad process dies · c07c0c81
    Mahmood Ali authored Apr 23, 2019
    Fixes https://github.com/hashicorp/nomad/issues/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
    c07c0c81

免费DevSecOps平台,让您的项目体验完整的DevSecOps流程,让项目更安全