Skip to content

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

Closed
d18zj wants to merge 6 commits intoexceptionless:mainfrom
d18zj:master
Closed

Lock conflicts occur when multiple sites (with ExceptionLess.net) are deployed on a server#257
d18zj wants to merge 6 commits intoexceptionless:mainfrom
d18zj:master

Conversation

@d18zj
Copy link
Copy Markdown
Contributor

@d18zj d18zj commented Apr 27, 2021

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

Copy link
Copy Markdown
Member

@niemyjski niemyjski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but would be good to get an extra pair of eyes on this! Thanks for the PR

@niemyjski niemyjski requested a review from ejsmith April 29, 2021 13:08
@ejsmith
Copy link
Copy Markdown
Member

ejsmith commented May 4, 2021

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
Copy link
Copy Markdown
Member

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

3 similar comments
@niemyjski
Copy link
Copy Markdown
Member

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

@niemyjski
Copy link
Copy Markdown
Member

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

@niemyjski
Copy link
Copy Markdown
Member

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

@ejsmith
Copy link
Copy Markdown
Member

ejsmith commented Apr 27, 2023

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

Copy link
Copy Markdown
Member

@ejsmith ejsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left feedback

@niemyjski
Copy link
Copy Markdown
Member

Thanks for reporting this issue and creating a pr. I'm closing this in favor of #305

@niemyjski niemyjski closed this May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants