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
FileTarget - Perform archive retry when concurrent file access #1889
Conversation
d6a56a9
to
130a503
Compare
Codecov Report
@@ Coverage Diff @@
## master #1889 +/- ##
=======================================
- Coverage 82% 82% -<1%
=======================================
Files 304 304
Lines 21106 21126 +20
Branches 2519 2528 +9
=======================================
- Hits 17264 17247 -17
- Misses 3211 3248 +37
Partials 631 631 |
53cb4f3
to
0da6b15
Compare
Test implemented, but apparently the archive mutex is not working well on the MONO-Platform (Even when using the Retrying-FileAppender). Disabled the archive test for MONO And it also seems that the concurrent-tests with async-wrapper is throwing random exceptions. And sometimes the files remains locked after process exit (Failing to cleanup temp-directory after completed test). Disabled throwing exceptions when non-archive test. |
543d305
to
f11f798
Compare
f036ab9
to
88c1fc0
Compare
Seems named Mutex (and named Semaphore-logic) has been removed on the Linux-platform with MONO ver. 4.4 (and has been disabled by default since MONO ver. 2.8) I guess a possible solution for the missing Mutex-handling in MONO (and .NET Core) on Linux, could be to create a subfolder in the file-logging-directory. And create a lock-file with the mutex-name for mutual-exclusion. Maybe an alternative way could be FileStream.Lock() and FileStream.Unlock(). Then the lock-file could be kept open, and not suffer a huge penalty for opening (and closing) the lock-file. Guess the same approach could be used to create a cross-platform FileLockMultiProcessFileAppender. |
8b625b4
to
31d6024
Compare
04cffb1
to
6164501
Compare
6164501
to
081ab0f
Compare
@304NotModified Synchronized with master, and after further discussions with myself decided not to change the naming of the mutex. Instead I have just changed this PR to allow retry to cater for concurrent file access issues (Like the retrying-file-appender attempts). |
081ab0f
to
a73f601
Compare
a73f601
to
5b1cab1
Compare
@304NotModified This is no longer a breaking change, and should improve stability of SimpleConcurrentTest (#2198) Will actually improve stability for all multi-process-file-writing with archive-logic enabled. |
2cfc04a
to
a734e82
Compare
a734e82
to
c4bc13e
Compare
great work! |
Extended Fix for #1887. Perform archive-retry when doing concurrent file-access.
Minor refactoring of BaseMutexFileAppender to make it easier to use. Inheriting from the class activates the archive mutex by default.
This change is