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

docker usage left pid file alive in case of crash #39

Open
jupe opened this issue Apr 12, 2022 · 1 comment
Open

docker usage left pid file alive in case of crash #39

jupe opened this issue Apr 12, 2022 · 1 comment

Comments

@jupe
Copy link

jupe commented Apr 12, 2022

Note that this issue is not obvious library bug, more like opening discussion around topic.

background: https://petermalmgren.com/signal-handling-docker/

use case:
pid library is used inside docker so that lock files are stored to mounted folder that host holds (not inside docker). Library lock down physical resource for test usage while tests are running. pid file is destroyed normally when tests ends but if for some reason test crashes pid module doesn't have chance to remove pid file and file left behind. This process pid is always 1 because of it's running inside docker.

problem:
if process dies and pid file with pid 1 left behind it means that next process thinks pid file is still valid and resource cannot be used until pid file is destroyed separately.

This is annoying issue that luckily happens rarely but haven't figure out yet any good solution to avoid such problem.

@jupe
Copy link
Author

jupe commented Feb 7, 2023

simple workaround for this is to use --pid=host docker option.

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

No branches or pull requests

1 participant