-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is the best approach. We could also substring it and add a guid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah well, it was already there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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