Conditionally use locks for the diagnostic.log file#72
Merged
jvillafanez merged 1 commit intomasterfrom May 20, 2021
Merged
Conversation
9af10c0 to
a4f8933
Compare
|
Kudos, SonarCloud Quality Gate passed! |
IljaN
approved these changes
May 19, 2021
a4f8933 to
c9d3874
Compare
|
Kudos, SonarCloud Quality Gate passed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #71
You'll likely need multiple servers connected via NFS and a heavy load to trigger the problem. Note that the file is written at the end of the request.
Taking into account that the problem has been reproduced with a custom isolated script, and that locking the file before writing has solved the problem, this is a preemptive action. Reproducing the problem with ownCloud hasn't been possible yet outside of what has been seen in the issue.
In addition, due to the performance hit of having to lock the file (and maybe waiting for the file to be unlocked), this locking mechanism is disabled by default because it might not be needed in simple installations.
Note that the checks has been performed with NFS v4.1. This solution hasn't been tested with NFS v3, and it might not work there.
Test script, for reference below. Note that the "testfile.log" is written inside a NFS directory