Skip to content
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

Fix freezing of CachingReloadableLoggers #40

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

nblumhardt
Copy link
Member

Fixes #39

The issue turned out to be logical rather than concurrency-related, but in the process of finding it I spotted some suspicious synchronization and got a bit more defensive about it, too.

if (cached != null && root == _logger)
{
newRoot = default;
newCached = default;
frozen = _frozen;
return (cached, frozen); // If we're frozen, then the caller hasn't observed this yet and should update.
Copy link
Member Author

Choose a reason for hiding this comment

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

The issue is here - even if frozen is true, the caching wrapper may never have seen the final logger (or any logger) - we need to propagate it as we do via line 375 in the new version.

@nblumhardt
Copy link
Member Author

I'm going to merge this since the published version is quite badly broken :( .. more eyes still appreciated on this if anyone has the time to take a look.

@nblumhardt nblumhardt merged commit 43c01c9 into serilog:dev Mar 2, 2021
@nblumhardt nblumhardt mentioned this pull request Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible Reloadable Logger Issue
1 participant