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

prometheus-ecs-discovery exits with 2 on SIGTERM #28

Open
iGEL opened this issue Dec 6, 2018 · 1 comment
Open

prometheus-ecs-discovery exits with 2 on SIGTERM #28

iGEL opened this issue Dec 6, 2018 · 1 comment

Comments

@iGEL
Copy link

iGEL commented Dec 6, 2018

When I send TERM to prometheus-ecs-discovery, it exits with the status 2. An exit status between 1 and 127 usually indicates an error, so we report this.

When a program ends because of a signal, it should exit with the exit code 128 + Signal number, see https://wiki.jenkins.io/display/JENKINS/Job+Exit+Status. When Docker wants to stop a container, it sends the TERM signal (TERM = 15) to the process in the container, so that process should terminate with code 143.

It would be great if prometheus-ecs-discovery would exit with 143 when receiving TERM instead of 2, so we don't get reports of failed processes just because we deployed it for example.

@toymachiner62
Copy link

I'm having the same issue when trying to call prometheus-ecs-discover -help and it's returning exit code 2. According to this thread golang/go#37533 I think by adding a help flag it will return a status code 0. The only reason it's returning a status code 2 is b/c the help flag isn't explicitly defined.

My use case is that i'm trying to verify in my docker image that I can call the prometheus-ecs-discovery executable as a sanity check but it's failing my circleci build due to returning exit code 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants