worker: Fix orphaned containers on node shutdown#3779
Merged
Conversation
This will prevent them from being restart on system boot
They should only be restart on failure as well, otherwise our watchdog will take over.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3779 +/- ##
===================================================
+ Coverage 31.68993% 31.69676% +0.00683%
===================================================
Files 158 158
Lines 47564 47579 +15
===================================================
+ Hits 15073 15081 +8
- Misses 31603 31611 +8
+ Partials 888 887 -1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
a282889 to
100a641
Compare
pwilczynskiclearcode
approved these changes
Oct 15, 2025
This reverts commit 100a641.
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.
What does this pull request do? Explain your changes. (required)
This fixes the shutdown process to actually wait for the
StartLivepeerfunction to exit,while increasing the timeout of doing so to up to 10s. We are frequently leaving orphaned
containers behind because 2s is not enough to both stop+remove them on ai-worker logic.
This ensure we give enough time for the
dockerRemoveContainerfunctions to run beforewe exit the process.
Also, removed the
RestartPolicy: alwaysfrom the warm containers. This can also cause orphanedcontainers in case of OS reboot, since docker will automatically restart the containers on reboot.
We already have a watchdog logic to make sure containers are healthy and restart them if not,
so the restart policy is redundant rn. Simplify it to just use up to 3 restarts
on-failurefor everyone.Specific updates (required)
How did you test each of these updates (required)
Kill O and make sure no containers are left behind
Does this pull request close any open issues?
Fixes #3776
Checklist:
makeruns successfully./test.shpass