exceptionless / Exceptionless.Net

Exceptionless clients for the .NET platform
https://exceptionless.com
Other
554 stars 142 forks source link

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

Closed d18zj closed 1 year ago

d18zj commented 3 years ago

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

ejsmith commented 3 years ago

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.

niemyjski commented 2 years ago

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

niemyjski commented 2 years ago

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

niemyjski commented 2 years ago

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

niemyjski commented 1 year ago

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

ejsmith commented 1 year ago

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

niemyjski commented 1 year ago

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