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

Use platform-dependent lock mechanism #269

Open
frankenjoe opened this issue Apr 4, 2023 · 5 comments
Open

Use platform-dependent lock mechanism #269

frankenjoe opened this issue Apr 4, 2023 · 5 comments
Labels
enhancement New feature or request load

Comments

@frankenjoe
Copy link
Collaborator

frankenjoe commented Apr 4, 2023

As discussed in #201 we have switched to a soft lock mechanism as a platform-independent lock mechanism. Unfortunately, this is not always safe and we can run into dead locks when a process is killed and the lock file is not removed. Since this is a very unfortunate behavior we should consider to switch back to a platform-dependent lock mechanism.

@frankenjoe frankenjoe changed the title Use platform-dependent lock mechanisms Use platform-dependent lock mechanism Apr 4, 2023
@hagenw hagenw added the enhancement New feature or request label Apr 4, 2023
@hagenw
Copy link
Member

hagenw commented Apr 4, 2023

The main possible downside of a platform-dependent lock file (FileLock on unix based systems, SoftFileLock on Windows) will be cases of a shared cache that is used with different platforms, e.g. will the Unix process wait until the Windows process is finished? What will happen with dead lock files?

@frankenjoe
Copy link
Collaborator Author

The main problem I see is that the unix process will not remove the lock file, so for the window process it still looks like the folder is locked.

@frankenjoe
Copy link
Collaborator Author

frankenjoe commented Apr 11, 2023

Maybe we can encode in .audb.yaml if a folder is shared across platforms and only in that case use the unsafe lock mechanism?

@hagenw
Copy link
Member

hagenw commented Apr 11, 2023

When setting up a shared folder, you do not necessarily know which platforms will access the folder, e.g. if it is a network share, so I don't see how you can store it inside the config. What we could do instead maybe is adding a hidden file to the shared folder the first time any Windows machine accessed it. Afterwards we know that we have to use lock files for that particular folder.

@frankenjoe
Copy link
Collaborator Author

Yes, that's sounds like a better solution.

@hagenw hagenw added the load label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request load
Projects
None yet
Development

No branches or pull requests

2 participants