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

ensure the current task is stopped before exit #148

Merged
merged 1 commit into from
Sep 7, 2019

Conversation

jesseduffield
Copy link
Owner

@jesseduffield jesseduffield commented Aug 6, 2019

fixes #147 (kinda)

For some reason we have child processes that are not being killed when lazydocker exits. To fix this, I'm making it so that before closing, lazydocker kills its task manager, which in turn kills the current task if there is any (e.g. docker logs <container id>). If the child process isn't killed in three seconds, it prints an error to stdout.

I have no idea why the child processes are not being killed when the parent is stopped in the first place. I considered maybe their group id is different, given we assign a group id to some subprocesses like docker-compose logs, but it seems that's not the case with docker logs. I am open to suggestions :)

@jesseduffield jesseduffield changed the title ensure the current task is stopped before exit so we don't have any c… ensure the current task is stopped before exit Aug 6, 2019
@codecov-io
Copy link

codecov-io commented Aug 6, 2019

Codecov Report

Merging #148 into master will decrease coverage by 0.32%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #148      +/-   ##
==========================================
- Coverage   26.44%   26.12%   -0.33%     
==========================================
  Files          13       13              
  Lines        1138     1129       -9     
==========================================
- Hits          301      295       -6     
  Misses        821      821              
+ Partials       16       13       -3
Impacted Files Coverage Δ
pkg/config/app_config.go 82.38% <0%> (-3.78%) ⬇️
pkg/commands/container.go 0% <0%> (ø) ⬆️
pkg/commands/docker.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a14e640...3f28a97. Read the comment docs.

Repository owner deleted a comment from golangcibot Aug 6, 2019
@jesseduffield jesseduffield merged commit 54609a5 into master Sep 7, 2019
@jesseduffield jesseduffield deleted the 147_child_processes branch September 7, 2019 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lazydocker is spawning orphaned docker logs processes
2 participants