prometheus / prometheus/node_exporter

Node exporter always return 143 when receiving a SIGTERM

Open
#2,356 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted
Dominant language
Go
Stars
13.8k
Forks
2.7k
Avg merge
1d 23h
Merged PRs (30d)
8

Description

Host operating system: output of uname -a

Linux fedora 5.15.14-200.fc35.x86_64 #1 SMP Tue Jan 11 16:49:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

latest version (as run by Docker)
quay.io/prometheus/node-exporter:latest

node_exporter command line flags

docker run -d --net="host" --pid="host" -v "/:/host:ro,rslave" 'quay.io/prometheus/node-exporter:latest' --path.rootfs=/host

Are you running node_exporter in Docker?
What did you do that produced an error?

docker stop <container_id>

What did you expect to see?

exit value code 0

What did you see instead?

Exit value code is always 143. It seems like node-exporter is not handling correctly the SIGTERM signal (sent when docker stop). The code value (143) is generated normally when a SIGTERM is sent by the underlying operating system. Hence we are stopping the container properly (using docker stop) the code value should be zero. Same happens when podman is used instead of docker.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior with the supplied Docker command and docker stop, then inspect node_exporter's signal and process-exit handling. Done means SIGTERM shutdown returns exit code 0 under Docker and Podman, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
devops, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.