Repository navigation
Add inspector auto-cleanup on interrupt - #3573
Merged
Merged
Conversation
Handle SIGINT/SIGTERM signals in the inspector command to automatically remove the inspector container when interrupted. Previously, interrupting left orphaned containers requiring manual cleanup. - Add signal handling with cleanup on Ctrl+C - Clean up container in both ready and startup states - Add E2E tests for auto-cleanup scenarios - Update existing tests to verify cleanup behavior Affected components: cmd/thv/app/inspector.go, test/e2e/ Signed-off-by: carlos <21148423+carlos-gn@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3573 +/- ##
==========================================
+ Coverage 65.51% 65.52% +0.01%
==========================================
Files 406 406
Lines 39996 39996
==========================================
+ Hits 26202 26206 +4
+ Misses 11762 11756 -6
- Partials 2032 2034 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: carlos <21148423+carlos-gn@users.noreply.github.com>
carlos-gn
marked this pull request as ready for review
February 3, 2026 16:10
carlos-gn
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
dmjb,
eleftherias,
jhrozek,
lujunsan,
rdimitrov and
yrobla
as code owners
February 3, 2026 16:10
eleftherias
reviewed
Feb 4, 2026
eleftherias
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR @carlos-gn! The code looks good. There's one failing test and I've left a couple of suggestions inline.
Signed-off-by: carlos <21148423+carlos-gn@users.noreply.github.com>
Signed-off-by: carlos <21148423+carlos-gn@users.noreply.github.com>
eleftherias
approved these changes
Feb 4, 2026
Member
|
Thanks @carlos-gn! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes: #995
Problem
Previously, interrupting the inspector command left orphaned containers that required manual cleanup with thv rm inspector.
Solution
The inspector now listens for interrupt signals and automatically removes its container before exiting. Cleanup is
performed whether the interrupt occurs during startup or after the inspector is fully ready.
Test plan