Skip to content

Terminate on SIGTERM #217

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

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bin/configurable-http-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,20 @@ if (options.redirectPort && listen.port !== 80) {
});
}

// trigger normal exit on sigint
// trigger normal exit on SIGINT
// without this, PID cleanup won't fire on SIGINT
process.on("SIGINT", function() {
log.warn("Interrupted");
process.exit(2);
});

// trigger normal exit on SIGTERM
// fired on `docker stop` and during Kubernetes pod container evictions
process.on("SIGTERM", function() {
log.warn("Terminated");
process.exit(2);
});

// log uncaught exceptions, don't exit now that setup is complete
process.on("uncaughtException", function(e) {
log.error("Uncaught Exception: " + e.message);
Expand Down