Files
nomad/command/agent/command.go
Chris Roberts 4dbf645bf7 command: prevent panic on graceful shutdown (#26018)
When performing a graceful shutdown a channel is used to wait for
the agent to leave. The channel is closed when the agent leaves
successfully, but it also is closed within a deferral. If the
agent successfully leaves and closes the channel, a panic will
occur when the channel is closed the second time within the
deferral. To prevent this from occurring, the channel closing
is wrapped within a `OnceFunc` so the channel is only closed
once.
2025-06-12 09:35:57 -07:00

55 KiB