-
Notifications
You must be signed in to change notification settings - Fork 11
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
Can we write pid to the lock file? #5
Comments
It is possible. Is the PID enough for the case when lock is held by handle and not by process? |
I recently got a deadlock issue between multiple processes, lack of PID is a pain when debugging. It took me hours to resolve it crypto-crawler/crypto-crawler-rs@eda33b5 |
I think it is reasonable to write it indeed. I would prefer this is optional. We could have a new method that opens and writes PID or perhaps a builder which can be configured to write the PID on open. I might implement it by myself, but anyone who'd like to implement it is welcome. |
Is it better to erase the PID when unlocked? Or should the PID be preserved until the next lock? |
Better erase the PID when unlocked |
Well, I believe I have an implementation for this on branch |
Ok, the PID writing by itself is correct in Unix version, but I found a bug on it unrelated to writing PID (see #6) . For Windows, I am having a small trouble. |
I solved Windows problem by locking just the very last possible byte of a file (and not the actual allocated last byte). So, I'd say this is solved. I will publish a new version when I can, but first I need to be sure about the solution of #6 (I replaced |
It would be useful if the lock file contains the PID. It's common user case that during debugging we want to know which process is holding the lock.
The text was updated successfully, but these errors were encountered: