Repository navigation
close the outgoing appenders before activating the new ones #321 - #322
Merged
Merged
Conversation
FreeAndNil
force-pushed
the
Feature/322-reconfiguration-file-lock
branch
from
September 19, 2026 21:07
cfc1317 to
1813208
Compare
- XmlHierarchyConfigurator activated a new appender while the outgoing one still held its file, so ConfigureAndWatch failed with "Unable to acquire lock on file" - regression from 592d18d (#287) - ParseAppender collects into _pendingActivations, which Configure drains once every logger has swapped - the symptom is Windows only: .NET on Linux does not enforce FileShare within a process, so the test asserts the open/close order instead
FreeAndNil
force-pushed
the
Feature/322-reconfiguration-file-lock
branch
from
September 21, 2026 18:20
1813208 to
d512f94
Compare
FreeAndNil
marked this pull request as ready for review
September 22, 2026 11:06
fluffynuts
approved these changes
Sep 22, 2026
gdziadkiewicz
approved these changes
Sep 22, 2026
gdziadkiewicz
left a comment
Contributor
There was a problem hiding this comment.
LGTM, asked Copilot to also take a look
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Two critical reconfiguration lifecycle issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Fixes appender file-lock overlap during XML reconfiguration by deferring activation until logger swaps complete.
Changes:
- Defers pending appender activation.
- Adds close-before-open regression coverage.
- Updates changelog references and test guidance.
| File | Summary |
|---|---|
src/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs |
Defers activation; two critical issues remain regarding activation-failure handling and premature publication. |
src/log4net.Tests/Config/XmlConfiguratorReconfigurationTest.cs |
Verifies outgoing appenders close before replacements open. |
src/changelog/3.5.0/321-reconfiguration-appender-overlap.xml |
Documents the reconfiguration fix. |
src/changelog/3.5.0/320-centralize-npm-dependencies.xml |
Corrects the related pull request reference. |
CLAUDE.md |
Documents temporary-folder test usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- deferring ActivateOptions moved it out of the ParseAppender catch - the failure is logged and the appender detached and closed - children are unwired first, so a container does not take them down
fluffynuts
approved these changes
Sep 22, 2026
gdziadkiewicz
approved these changes
Sep 22, 2026
This was referenced Oct 1, 2026
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #321
ParseAppendernow collects into_pendingActivations, drained once every logger has swapped; the atomic swap from Reduce silent log event loss during XmlConfigurator reconfiguration #287 staysnet462: oneUnable to acquire lockper run before, none after