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

fix(kaniko): resolve blocking on Ctrl+C during Docker context creation #9269

Merged

Conversation

idsulik
Copy link
Contributor

@idsulik idsulik commented Jan 20, 2024

Description

This commit resolves a deadlock issue in Skaffold where sending a Ctrl+C interrupt during the Docker context creation process, specifically while executing tw.WriteHeader(header) in pkg/skaffold/util/tar.go, would cause an indefinite block. The solution implemented adds a select statement to handle the context cancellation, allowing the process to exit gracefully.


User facing changes

Before: Previously, when a user pressed Ctrl+C during the Docker context creation with Kaniko, Skaffold would block indefinitely, requiring manual termination of the process.

After: With the fix, Skaffold now responds to Ctrl+C interrupts promptly during the Docker context creation, terminating the process gracefully and avoiding a deadlock.

This commit addresses an issue where the application would block indefinitely when receiving a Ctrl+C interrupt during the Docker context creation process handled by Kaniko.
@idsulik
Copy link
Contributor Author

idsulik commented Jan 26, 2024

the bug also happens when you try to call Ctrl + C on kaniko build retry:
image

As you can see on the screen, I tried to close the process, but it didn't respond me, I had to kill it

p.s. the build context failed because of timeout, fix is here #9267

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 295 lines in your changes are missing coverage. Please review.

Comparison is base (290280e) 70.48% compared to head (df063fd) 63.56%.
Report is 1103 commits behind head on main.

Files Patch % Lines
cmd/skaffold/app/cmd/exec.go 16.32% 40 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/filter.go 47.27% 22 Missing and 7 partials ⚠️
cmd/skaffold/app/cmd/lsp.go 28.12% 23 Missing ⚠️
cmd/skaffold/app/cmd/verify.go 23.33% 23 Missing ⚠️
cmd/skaffold/app/cmd/fix.go 51.16% 17 Missing and 4 partials ⚠️
cmd/skaffold/app/cmd/inspect_job_manifest_paths.go 60.00% 15 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/inspect_namespaces.go 50.00% 13 Missing and 1 partial ⚠️
...md/skaffold/app/cmd/inspect_config_dependencies.go 45.83% 12 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/lint.go 42.85% 12 Missing ⚠️
cmd/skaffold/app/cmd/inspect_build_env.go 60.71% 11 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9269      +/-   ##
==========================================
- Coverage   70.48%   63.56%   -6.92%     
==========================================
  Files         515      634     +119     
  Lines       23150    32712    +9562     
==========================================
+ Hits        16317    20794    +4477     
- Misses       5776    10315    +4539     
- Partials     1057     1603     +546     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ericzzzzzzz ericzzzzzzz merged commit e4f1975 into GoogleContainerTools:main Jan 31, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants