FreeAndNil opened a new issue, #367:
URL: https://github.com/apache/logging-log4net/issues/367
Outside Windows, processes sharing one log file do not keep out of each
other's way:
- `MinimalLock` opens the file per event with `FileShare.Read`. On Windows a
second writer gets a
sharing violation; on Linux .NET maps it to a shared `flock`, so a second
writer gets in. Both
write at the end of file they saw at open, and the later write replaces
the earlier event, without
any report. About 1% lost with two processes at ordinary rates. Since
2.0.6. ANT-2026-JC5GM7W7.
- The named mutexes of `InterProcessLock` and of `RollingFileAppender`'s
rolling have no `Global\`
prefix, so outside Windows they are per session: two services, a service
and a cron job, or two
logins do not exclude each other. `InterProcessLock` across sessions lost
59 of 20,000 records,
with the default `ImmediateFlush=true`.
Proposed fix: outside Windows, `MinimalLock` takes the same named mutex as
`InterProcessLock` around
each open and close; readers stay unblocked. Outside Windows all three mutex
names get the `Global\`
prefix. Windows unchanged. Document the limit: the runtime keeps these
mutexes per user, so writers
are coordinated on one host under one user account with a writable home
directory. Old and new
versions use different names and do not exclude each other during an upgrade.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]