profile
viewpoint

Ask questions`nomad job stop` sends `interrupt` signal for docker driver?

Nomad version

Nomad v0.13.0-dev (fb170f37a05d712e3046d604c362804c7934cfc9+CHANGES)

Operating system and Environment details

Ubuntu 20.04.1 LTS

Issue

Reproduction steps

Not too sure why nobody has noticed, but it seems like nomad job stop sends a docker task the interrupt signal, as opposed to the expected TERM as per https://www.nomadproject.io/docs/job-specification/task#kill_signal

To confirm this, I basically added debug logging to https://github.com/hashicorp/nomad/blob/943854469db945631e79ccd0f8014cdb1e584963/drivers/docker/handle.go#L127

My debug output for the signal parameter gives interrupt.

My first clue was from my alloc logs, where I see 'Sent interrupt'. The line from nomad job stop is called out below

Time                  Type        Description
2020-09-19T10:50:04Z  Killing     Sent interrupt. Waiting 30s before force killing
2020-09-19T10:50:04Z  Killed      Task successfully killed
2020-09-19T10:50:04Z  Terminated  Exit Code: 1, Exit Message: "Docker container exited with non-zero exit code: 1"
2020-09-19T10:50:02Z  Killing     Sent interrupt. Waiting 30s before force killing                 --> did `nomad job stop` here
2020-09-19T10:45:51Z  Started     Task started by client
2020-09-19T10:45:37Z  Driver      Downloading image
2020-09-19T10:45:37Z  Task Setup  Building Task Directory
2020-09-19T10:45:34Z  Received    Task received by client

Job file (if appropriate)

any standard job file will do; you can use the example file from nomad job init too

hashicorp/nomad

Answer questions jf

Sure. I just had the impression (as I believe most folks would as well) from the docs (https://www.nomadproject.io/docs/job-specification/task#kill_signal) that my tasks would be getting TERM instead of KILL

useful!

Related questions

using `exec` driver result into RPC error hot 1
Cannot download private git repo with artifact stanza hot 1
[BUG] cannot allocate memory hot 1
Start Job button in UI breaks with Vault policies and allow_unauthenticated = false hot 1
[question]/[bug]? Consul Agent Default ACL token not used by Nomad Client - nomad hot 1
Allocation left in pending state after node lost hot 1
job still running though received kill signal hot 1
Allocation left running but task failing hot 1
[BUG] cannot allocate memory hot 1
Cannot use consul connect deployed through nomad with envoy proxy on centos 7 hot 1
Spread/affinity values in allocations may generate invalid JSON (and may not be working correctly) hot 1
[BUG] Allocs GC not work when Jobs is deleted by API. hot 1
Support Consul Connect with Consul TLS enabled hot 1
Tasks that are signaled to restart fail due to logmon errors hot 1
nomad stuck on (re)start hot 1
source:https://uonfu.com/
Github User Rank List