FileTarget: Fix file archive race-condition.#1646
FileTarget: Fix file archive race-condition.#1646
Conversation
|
Guess we don't have a |
…(no Mutex class on Silverlight).
# Conflicts: # src/NLog/Targets/FileTarget.cs
…(no Mutex class on Silverlight).
Current coverage is 80% (diff: 80%)@@ master #1646 diff @@
==========================================
Files 273 273
Lines 16699 16727 +28
Methods 2653 2660 +7
Messages 0 0
Branches 1840 1843 +3
==========================================
+ Hits 13271 13305 +34
+ Misses 3009 3002 -7
- Partials 419 420 +1
|
| // The unusual case of the path being too long; let's hash the canonical name, | ||
| // so it can be safely shortened and still remain unique | ||
| string hash; | ||
| using (MD5 md5 = MD5.Create()) |
There was a problem hiding this comment.
not sure if this is the best approach. We could also substring it and add a guid?
There was a problem hiding this comment.
ah well, it was already there?
There was a problem hiding this comment.
Yes, this code came from MutexMultiProcessFileAppender. Adding a Guid won't work, because a different process will compute a different Guid for the same file. We need the same file to have the same mutex-name across processes.
304NotModified
left a comment
There was a problem hiding this comment.
One note about the md5
|
@304NotModified unfortunately, I cannot produce the error from #1608 anymore, even with the old NLog.dll (it stopped happening; I don't know why). We must probably make a hidden package again so viseu can test again. |
Fix #1608
This change is