GeezerVison is showing github.com — close the outgoing appenders before activating the new ones #321 by FreeAndNil · Pull Request #322 · apache/logging-log4net
Conversation
FreeAndNil
commented
Sep 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
FreeAndNil
changed the title
Feature/322 reconfiguration file lock
close the outgoing appenders before activating the new ones #321
Sep 19, 2026
- 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
- the entry claimed #321, which is the FileAppender reconfiguration issue,
filed a day after this landed
- the Antora dependency work came through #320, so the id, the link and
the file name follow that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, asked Copilot to also take a look
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- 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
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 1, 2026
This was referenced Nov 12, 2026
This was referenced Nov 19, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
|