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

PID lock file doesn't work well when running Horcrux inside Docker #250

Open
lhopki01 opened this issue Feb 7, 2024 · 1 comment
Open
Assignees

Comments

@lhopki01
Copy link

lhopki01 commented Feb 7, 2024

When Horcrux is run inside Docker the PID it is assigned is almost always the same one. If Horcrux shutsdown improperly and leaves behind the PID lock file then there are issues. The current check panics if the current PID is the same as the PID in the file and doesn't clean up the file like it does if the PIDs are different and the lock file PID doesn't exist anymore.

if int(pid) == os.Getpid() {
panic(fmt.Errorf("error checking PID file: %s, PID: %d matches current process",
pidFilePath, pid))
}

Could this check be removed or a flag added to ignore it?

@lhopki01
Copy link
Author

lhopki01 commented Feb 27, 2024

Currently we have to do this on every start.

if [ -f /home/horcrux/.horcrux/horcrux.pid ]; then
  echo "Fixing PID lock file till https://github.com/strangelove-ventures/horcrux/issues/250 is addressed"
  echo 9999 > /home/horcrux/.horcrux/horcrux.pid
fi

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

2 participants