GeezerVison is showing github.com — Fixes from the 2026-11 audit, part 5: BackgroundSender and syslog by FreeAndNil · Pull Request #373 · apache/logging-log4net
Conversation
#370, #371, #372 Fixes from the 2026-11 audit, part 5: BackgroundSender and syslog
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Dispose after Close no longer repeats it, a grown total is reported again
- RecordingSink replaces the shared recordings in BackgroundSenderTest
- AGENTS.md allows one fixture instance per test
- ANT-2026-M13HDM0A
- shared partial for the background sending of the three appenders
- sender reports name a message instead of a logging event
- ANT-2026-C2Q2AQZL
- the error may belong to the datagram before, on Linux
- docs on maxDatagramSize behind a router with a smaller MTU
- ANT-2026-6O92ZO65
- a value set after ActivateOptions escapes instead of keeping the line breaks
- ANT-2026-1YRNCBP9
- VT, FF, FS, GS, RS, NEL, U+2028 and U+2029 as \uXXXX in Escape and Split
… caller
- CallerArgumentExpression, hidden from IntelliSense, signature breaks on purpose
- all 32 call sites drop the name
- ValidateIndex reports "index" instead of "i"
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.
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.
FreeAndNil
commented
Nov 22, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Implementation plan for #373, kept here for the record. Written up to describe the change as it stands on the branch.
Plan
Fixes from the 2026-11 audit, part 5: BackgroundSender and syslog
Context
The same scan as #355 reported, among the lows, problems in the background senders and the syslog
appenders: a full send queue makes every logging call wait the full timeout, RemoteSyslogAppender
loses a record after an ICMP error, and LocalSyslogAppender lets an undefined NewLineHandling
and line breaks other than CR and LF through raw. The close summary reported twice turned up while
fixing them. Three issues: #370 (the background sender), #371 (the ICMP error), #372 (newline
handling).
Constraints that shape the design
BackgroundSender<T> is shared by TelnetAppender, RemoteSyslogAppender and the
SmtpAppender of log4net.Ext.Mail; a fix there applies to all three.
- With a dead sink each event waits
EnqueueTimeoutMillis before it is dropped, so the logging
thread stalls for the timeout times the number of events.
- On Linux a connected UDP socket reports the ICMP error of one datagram on the next send, so the
record that fails is not the one that caused it.
RemoteSyslogAppender already rejects an undefined NewLineHandling on activation;
LocalSyslogAppender did not.
- No new public API in a patch release; a hidden helper may break its signature on purpose.
Changes
- Background senders wait per event when the queue is full and report the close summary twice #370 The close summary is reported once per count: the sender keeps the count it last reported.
- Background senders wait per event when the queue is full and report the close summary twice #370 After an enqueue timed out, later events drop at once until a send succeeds; the pump
clears the flag. Reports say "message", as for all three appenders.
- RemoteSyslogAppender loses the record after an ICMP error #371
RemoteSyslogAppender.Send sends once more after a SocketException; the error is
reported.
- LocalSyslogAppender lets an undefined NewLineHandling and other line breaks through raw #372
LocalSyslogAppender.ActivateOptions rejects an undefined NewLineHandling; a value set
later is escaped.
- LocalSyslogAppender lets an undefined NewLineHandling and other line breaks through raw #372
Escape and Split write VT, FF, FS, GS, RS, NEL, U+2028 and U+2029 as \uXXXX; Keep
stays raw.
- LocalSyslogAppender lets an undefined NewLineHandling and other line breaks through raw #372
SystemInfo.CreateArgumentOutOfRangeException takes the parameter name from
CallerArgumentExpression and is hidden from IntelliSense; all call sites drop the name.
Docs: a shared partial background-sender.adoc for the Telnet, RemoteSyslog and Smtp pages, the
remotesyslog size limits on the MTU case, the localsyslog newline handling, XML doc comments of the
changed members. One changelog entry per change in src/changelog/3.6.1.
Sequencing
- The close summary first; the later tests expect it once.
- The congested flag on top, same file.
- The syslog retry.
- The
NewLineHandling range check, then the other line breaks in the same switch.
- The parameter name last; it adds a call site from step 4.
- Each commit: test against the unfixed code first, fix, mutate each changed line, review loop.
Verification
dotnet build of all targets with 0 warnings, tests on net10 and, on Windows, net462.
- A recording sink pins sends, reports and the close summary of
BackgroundSender.
- A full queue: the first event waits, the next ones drop at once, a successful send restores the
wait.
- A UDP mock throws a
SocketException once: the record is sent on the second try and the error
reported.
LocalSyslogAppender: an undefined value fails activation; each of the eight line breaks is
escaped in Escape and Split and kept in Keep.
ParamName checked for a range error from SystemInfo, LevelMap, an appender collection index
and the Ext.Mail queue size.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
fluffynuts
Awaiting requested review from fluffynuts
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.
|