mirror of
https://github.com/status-im/consul.git
synced 2025-02-03 01:14:23 +00:00
43ab372a18
The previous fix to `consul lock` (commit 6875e8d) didn't completely eliminate the race that could occur if the lock was acquired around the same time SIGTERM was received: It was still possible for Run() to spawn the process via startChild() after killChild() had released the shared mutex. Now, when SIGTERM is received, we acquire a mutex that prevents spawning a new process and never release it. We've tested this fix pretty thoroughly and believe it completely resolves the issue.