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

Safe write #472

Open
kalemas opened this issue Sep 24, 2024 · 2 comments · May be fixed by #473
Open

Safe write #472

kalemas opened this issue Sep 24, 2024 · 2 comments · May be fixed by #473

Comments

@kalemas
Copy link
Collaborator

kalemas commented Sep 24, 2024

Hi, @krathjen

It is not clear, the problem the algorithm in studiolibrary.utils.write() resolves. Doc string do not state this.

raise IOError(msg)

  1. This code creates a .tmp file and in case of sudden termination this file will not be cleanup and StufioLibrary will stop to work.
  2. With distributed workflows this .tmp file seems to prevent concurrent save operations. It may work as expected: if two users call write simultaneously one of them will got exception and will have to repeat adding new item. That is good, but may be there would be better approach that will not throw errors.
  3. Library synchronization with BitTorrent, or Dropbox or rclone as I do, may be long enough and those .tmp files may not cleanup in time, and sometimes we encounter save item failures. Database file would conflict or do not correspond to actually synced files. So it seem that StudioLibrary is not intended to be used with such synchronization solutions.

What do you think?

@kalemas
Copy link
Collaborator Author

kalemas commented Sep 25, 2024

Yep, if for some reason there is .tmp file, it is impossible to save any pose, you only able to remove that .tmp file by hands, and most of users are not aware of that file((

@kalemas
Copy link
Collaborator Author

kalemas commented Sep 25, 2024

I have different thoughts but simplest solution i could mind is to check modification time of .tmp file and if it is older than minute, remove it.

@kalemas kalemas linked a pull request Sep 25, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant