-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cmd/docker: add cause to user-terminated context.Context
#5760
base: master
Are you sure you want to change the base?
Conversation
This patch adds a "cause" to the `context.Context` error when the user terminates the process through SIGINT/SIGTERM. This allows us to distinguish the cause of the `context.Context` cancellation. In future we would also be able to improve the UX of printed errors based on the underlying cause. Signed-off-by: Alano Terblanche <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5760 +/- ##
==========================================
- Coverage 59.47% 59.42% -0.05%
==========================================
Files 346 347 +1
Lines 29367 29433 +66
==========================================
+ Hits 17465 17491 +26
- Misses 10929 10969 +40
Partials 973 973 |
Signed-off-by: Alano Terblanche <[email protected]>
Signed-off-by: Alano Terblanche <[email protected]>
8839f12
to
bdd630c
Compare
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 test looks solid. TestUserTerminatedError
test case properly introduces notifyContext
and handles the termination signals as expected.
1cad6c0
to
da5701e
Compare
Please don't merge yet, this is incorrect. We need to have status 130 print when a container exits with that code. |
da5701e
to
bdd630c
Compare
This patch adds a "cause" to the
context.Context
error when the user terminates the process through SIGINT/SIGTERM.This allows us to distinguish the cause of the
context.Context
cancellation. In future we would also be able to improve the UX of printed errorsbased on the underlying cause.
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)