Skip to content

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

Open
FelixMarxIBM wants to merge 2 commits intoapache:masterfrom
instana:FELIX-6515
Open

FELIX-6515: Add global write lock to write back cfg files#233
FelixMarxIBM wants to merge 2 commits intoapache:masterfrom
instana:FELIX-6515

Conversation

@FelixMarxIBM
Copy link
Contributor

@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
Contributor 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