Repository navigation
Conversation
…rite The daemon appended UDP-forwarded log lines with @file_put_contents() and ignored failures, so when the target file was not writable by the daemon either, the line vanished without trace. Check the write and, on failure, record the lost line through the daemon's own logger (except for admin_daemon.log itself). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
TITLE: Admin daemon: don't silently drop UDP-forwarded log lines it cannot write
Problem
When a process cannot write its own log file,
Logger::log()forwards the line to the admin daemon over UDP, and the daemon appends it to the same target with@file_put_contents(). The return value is ignored. When the daemon cannot write that file either (for example it is owned by a different user than the daemon runs as), the line is lost with no trace anywhere.Impact
Detailed traces, such as BinkP poll session logs written by processes the daemon spawns, disappear exactly when a file-ownership problem exists. That is the moment they are needed to diagnose it.
Repair
AdminDaemonServer::writeLogLineOrWarn()checks the write. On failure it logs a warning through the daemon's own logger with the target file name, sender pid, and the lost line. It skips the warning when the failing target isadmin_daemon.logitself, to avoid recursion.Proof
tests/Unit/AdminDaemonUdpLogFallbackTest.phpforces a portable write failure by pointing the target at a directory. It has 4 tests: failure warns with the lost line, success writes normally, the self-target guard holds, and the line is written verbatim. It errors on the current branch (3 errors) and passes with the change. The rest oftests/Unitis unchanged.