Exceptionless.Net icon indicating copy to clipboard operation
Exceptionless.Net copied to clipboard

Lock conflicts occur when multiple sites (with ExceptionLess.net) are deployed on a server

Open d18zj opened this issue 4 years ago • 4 comments

Mutex is a cross-process lock,Lock conflicts occur when multiple sites (with ExceptionLess.net) are deployed on a server

d18zj avatar Apr 27 '21 09:04 d18zj

It's been a long time, but I'm pretty sure it's using a cross process lock on purpose. If you have multiple clients using the same log file then you need to make sure only one of them is appending to the file at the same time.

What behavior are you seeing that is causing issues? They should be retrying when they get conflicts.

ejsmith avatar May 04 '21 13:05 ejsmith

@d18zj could you please comment on @ejsmith's question.

niemyjski avatar Dec 30 '21 15:12 niemyjski

@d18zj could you please comment on @ejsmith's question.

niemyjski avatar Jan 25 '22 14:01 niemyjski

@d18zj could you please comment on @ejsmith's question.

niemyjski avatar May 10 '22 11:05 niemyjski

@d18zj could you please comment on @ejsmith's question.

niemyjski avatar Apr 27 '23 14:04 niemyjski

So I do see an issue with us taking a global cross process lock based on just the class name and not the log file we are trying to write to. We should change this to use a Mutex based on the file name like this implementation: https://github.com/bhaeussermann/NLog/blob/master/src/NLog/Internal/FileAppenders/MutexMultiProcessFileAppender.cs#L76

ejsmith avatar Apr 27 '23 16:04 ejsmith

Thanks for reporting this issue and creating a pr. I'm closing this in favor of https://github.com/exceptionless/Exceptionless.Net/pull/305

niemyjski avatar May 03 '23 13:05 niemyjski