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

FELIX-6515: Add global write lock to write back cfg files #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FelixMarxIBM
Copy link

@FelixMarxIBM FelixMarxIBM commented Aug 30, 2023

Writing a file is a 2 step process where the file is created empty and then filled
There is a race-condition, where the DirectoryWatcher might pick up the creation of the empty file.
This empty file will be written back to disk on a follow-up CM_UPDATED event.
Using the global write lock will block the DirectoryWatcher to wait for the write to finish and therefore never to read an empty file.

* Writing a file is a 2 step process where the file is created empty and then filled
* There is a race-condition, where the DirectoryWatcher might pick up the creation of the
* empty file. This empty file will be written back to disk on a follow-up CM_UPDATED event.
* Using the global write lock will block the DirectoryWatcher to wait for the write to finish
* and therefore never to read an empty file.
@FelixMarxIBM
Copy link
Author

I'll try to create a test for this race-condition but doing that might be hard to accomplish.

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 this pull request may close these issues.

1 participant