GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@FreeAndNil FreeAndNil commented Sep 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #321

  • since Reduce silent log event loss during XmlConfigurator reconfiguration #287 (3.3.1) the new appenders were activated, and so opened their file, before the old ones were closed
  • ParseAppender now collects into _pendingActivations, drained once every logger has swapped; the atomic swap from Reduce silent log event loss during XmlConfigurator reconfiguration #287 stays
  • verified on Windows, net462: one Unable to acquire lock per run before, none after
  • Linux cannot show the symptom, so the test asserts the open/close order instead

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@FreeAndNil
FreeAndNil force-pushed the Feature/322-reconfiguration-file-lock branch from cfc1317 to 1813208 Compare September 19, 2026 21:07
@FreeAndNil FreeAndNil mentioned this pull request Sep 19, 2026
File lock error when using FileAppender with XmlConfigurator.ConfigureAndWatch (v3.3.1) #321
Closed
@FreeAndNil FreeAndNil changed the title Feature/322 reconfiguration file lock close the outgoing appenders before activating the new ones #321 Sep 19, 2026
FreeAndNil added 2 commits September 21, 2026 20:20
@FreeAndNil
close the outgoing appenders before activating the new ones #321
642bdd2
- 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
point the npm changelog entry at its own pull request
d512f94
- 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
@FreeAndNil
FreeAndNil force-pushed the Feature/322-reconfiguration-file-lock branch from 1813208 to d512f94 Compare September 21, 2026 18:20
@FreeAndNil
FreeAndNil changed the base branch from master to Feature/2.x September 22, 2026 11:05
@FreeAndNil
FreeAndNil changed the base branch from Feature/2.x to master September 22, 2026 11:05
@FreeAndNil
FreeAndNil marked this pull request as ready for review September 22, 2026 11:06
@FreeAndNil FreeAndNil added this to the 3.5.0 milestone Sep 22, 2026
@FreeAndNil
FreeAndNil requested review from fluffynuts and gdziadkiewicz September 22, 2026 11:07
fluffynuts
fluffynuts approved these changes Sep 22, 2026
View reviewed changes
@gdziadkiewicz
gdziadkiewicz requested a lite review from Copilot September 22, 2026 12:00
gdziadkiewicz
gdziadkiewicz approved these changes Sep 22, 2026
View reviewed changes

@gdziadkiewicz gdziadkiewicz left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
Copilot started reviewing on behalf of gdziadkiewicz September 22, 2026 12:08
View session
Copilot AI reviewed Sep 22, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 High severity

Open (2)
  • High severity Deferred activation failures escape and leave partial configuration · New
  • High severity Appenders publish before activation, allowing concurrent file access races · New
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.

All reactions
Comment thread src/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@FreeAndNil
discard an appender that fails to activate #321
93ed24f
- 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
fluffynuts approved these changes Sep 22, 2026
View reviewed changes
gdziadkiewicz
gdziadkiewicz approved these changes Sep 22, 2026
View reviewed changes
@FreeAndNil
FreeAndNil merged commit 781b4a8 into master Sep 22, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@FreeAndNil
FreeAndNil deleted the Feature/322-reconfiguration-file-lock branch September 22, 2026 19:04
This was referenced Oct 1, 2026
Bump the all-nuget-updates group with 5 updates drmoisan/TaskMaster#962
Closed
Bump the nuget-dependencies group with 13 updates SvenGroot/JumboCore#65
Closed
Bump log4net and 11 others SvenGroot/JumboCore#66
Closed
Bump log4net from 3.4.0 to 3.5.0 loresoft/KickStart#327
Merged
Bump log4net from 3.4.0 to 3.5.0 ParadoxGameConverters/PGCG.commonItems#941
Merged
Bump log4net from 3.3.1 to 3.5.0 bbtsoftware/AzureDevOpsPolicyConfigurator#253
Closed
Bump the dependencies group with 5 updates guibranco/CrispyWaffle#1000
Merged
Bump the nuget-minor-and-patch group with 1 update filmliga66/drive-mapper#16
Merged
This was referenced Nov 12, 2026
Bump the nuget-dependencies group with 14 updates SvenGroot/JumboCore#78
Closed
Bump Crc32.NET and 12 others SvenGroot/JumboCore#79
Closed
Bump log4net from 3.3.2 to 3.5.0 jasonlandreth/GarminR10-BLE-Connector#6
Closed
DEV: Bump log4net from 3.4.0 to 3.5.0 origam/origam#5193
Merged
DEV: Bump log4net from 3.4.0 to 3.5.0 origam/origam#5194
Merged
DEV: Bump log4net from 3.4.0 to 3.5.0 origam/origam#5195
Merged
DEV: Bump log4net from 3.4.0 to 3.5.0 origam/origam#5196
Merged
DEV: Bump log4net from 3.4.0 to 3.5.0 origam/origam#5197
Merged
DEV: Bump log4net from 3.4.0 to 3.5.0 origam/origam#5198
Merged
Bump log4net from 3.3.0 to 3.5.0 chutch3/kenku#87
Merged
Bump log4net from 2.0.15 to 3.6.0 sg-scale/NETworkManager--2022.12.20.0#5
Open
Bump the minor-version-updates group with 4 updates PxTools/PCAxis.Menu.OracleDatamodelMenu#115
Merged
Bump log4net and 3 others PxTools/PCAxis.Metadata#108
Merged
Bump Crc32.NET and 12 others SvenGroot/JumboCore#80
Closed
Bump the nuget-dependencies group with 14 updates SvenGroot/JumboCore#81
Closed
Bump log4net and 4 others PxTools/PCAxis.Menu.MsSqlDatamodelMenu#114
Merged
Bump log4net and 3 others PxTools/PXWeb.SavedQuery.Oracle#119
Merged
Bump log4net and 4 others PxTools/PCAxis.Core#142
Merged
Bump log4net from 3.3.1 to 3.6.0 bbtsoftware/AzureDevOpsPolicyConfigurator#255
Open
Bump the minor-version-updates group with 4 updates PxTools/PCAxis.Menu#100
Merged
Bump log4net and 3 others PxTools/PCAxis.Query#113
Merged
Bump log4net and PCAxis.Core PxTools/PCAxis.Query#114
Closed
Bump log4net from 2.0.8 to 3.6.0 devsecops-lab-luis/demo-ghas-multilenguaje#27
Open
Dependency (dependabot/nuget): Bump log4net from 3.3.0 to 3.6.0 Nevergoodstudy/NETworkManager-macOS#24
Open
Bump the nuget-dependencies group with 14 updates SvenGroot/JumboCore#82
Open
Bump Crc32.NET and 12 others SvenGroot/JumboCore#83
Open
deps: Bump log4net from 3.3.2 to 3.6.0 OliverRetro/WavePlus#62
Open
Bump log4net from 3.3.1 to 3.6.0 bNobo/needabreak#176
Open
This was referenced Nov 19, 2026
Bump log4net from 3.3.2 to 3.6.0 jasonlandreth/GarminR10-BLE-Connector#7
Open
Bump Crc32.NET and 12 others SvenGroot/JumboCore#84
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@fluffynuts fluffynuts fluffynuts approved these changes
@gdziadkiewicz gdziadkiewicz gdziadkiewicz approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

3.5.0

Development

Successfully merging this pull request may close these issues.

File lock error when using FileAppender with XmlConfigurator.ConfigureAndWatch (v3.3.1)

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@FreeAndNil @fluffynuts @gdziadkiewicz
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.