local_resource can leave running processes after Tilt is terminated
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 10.1k
- Forks
- 413
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 6
Description
Expected Behavior
- All
local_resourceprocesses terminate when Tilt terminates- This is different than
k8s_resourcebehavior which are left untiltilt downbut is the expected current behavior
- This is different than
Current Behavior
- Processes can be left behind under some circumstances
- Tilt quits unexpectedly (e.g. panic due to a Tilt bug)
- User hits
Ctrl-Ctwice in rapid succession - Process doesn't respond to
SIGTERM- Tilt only waits 2 seconds on shutdown, we only send a
SIGKILLif process takes more than 30 secs to respond toSIGTERM
- Tilt only waits 2 seconds on shutdown, we only send a
Steps to Reproduce
See cases above - a good real world example is docker run --rm ..., especially if it doesn't respond well to SIGTERM which is fairly common, especially with entrypoint trampolines in some containers
Context
There's no way to ask the OS to kill all child processes when the parent exits. The most robust way looks to be to use an intermediate process that keeps an eye on the parent process and then kills the real child and exits itself.
We can at least do a little bit better here in the exit code by ensuring we SIGKILL everything before giving up after 2 seconds and/or on second Ctrl-C.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how local_resource processes are started and how Tilt handles shutdown and repeated Ctrl-C. Reproduce the listed termination cases, then verify that all local_resource processes are forcibly terminated within the expected shutdown behavior, including when SIGTERM is ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100