This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On SIGTERM default to a non-zero exit code #21300
On SIGTERM default to a non-zero exit code #21300
Changes from all commits
db24947
7853aab
73a39ae
ba3e53b
eb976a4
371cd23
95051d8
75dea6c
fa5de42
2e13cad
17ae6ea
b0bc41c
d89a547
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the SIGTERM causes an int-returning Program.Main to exit gracefully and return a non-zero exit code?
I'm aware of dotnet/aspnetcore#6526 which tracks using Environment.ExitCode in the ProcessExit event to set the process exit code to zero when the ASP.NET host exits gracefully.
I'm more concerned about apps that return custom exit codes from Program.Main. Today this works as long as you avoid
dotnet run
as demonstrated in dotnet/corefx#32749. Now that dotnet/cli#10544 has been merged,dotnet run
shouldn't even be an issue going forward.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The program observing the exit code will assume the application didn't exit gracefully.
The ProcessExit handler must be aware of those. It can behave different based on the Environment.ExitCode value.