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

Atomic writes of id file #46

Open
pfranz opened this issue Oct 5, 2016 · 1 comment
Open

Atomic writes of id file #46

pfranz opened this issue Oct 5, 2016 · 1 comment

Comments

@pfranz
Copy link

pfranz commented Oct 5, 2016

We had an unexpected power failure and the id file was corrupted on disk. It looks like this has happened before to us. Also, we have a monitoring service that often loads an incomplete id file.

While it's not 100% guaranteed to be atomic, many tools write to a temp file and rename it in place. Some OSes guarantee atomicity and for the rest it should at least be a significant improvement.

@herronelou
Copy link

herronelou commented Sep 7, 2024

I'm pretty sure this has affected us too, the daemon seems to spend a non-insignificant amount of time between creating the file handle and finishing the pickling (https://github.com/shotgunsoftware/shotgunEvents/blob/master/src/shotgunEventDaemon.py#L605).

Every time we stop the daemon, it's like there's a 5% chance of hitting this spot and corrupting the file. I think it might be one of the root causes of #63

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