Narrow socket semantic logging scope - #233
Merged
Merged
Conversation
Signed-off-by: Volker Christian <me@vchrist.at>
VolkerChristian
marked this pull request as ready for review
August 16, 2026 17:58
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.
Summary
Root cause
Socket reader/writer event receivers were constructed from display names such as [fd] instance, while SocketConnection already owned the canonical inst/role/conn identity. Writer and TLS diagnostics also bypassed that owner and reconstructed textual identity. This allowed the OS descriptor and compatibility display name to leak into semantic framework records.
The remaining unscoped ReadEventReceiver and WriteEventReceiver constructors also let Pipe, MariaDB, and standalone TLS helper paths silently fall back to generic identity even when a coherent owner identity was available. Two TLS handshake-error callbacks likewise used getConnectionName with the generic TLS logger instead of the owning connection logger.
Implementation
DescriptorEventReceiver retains two deliberate semantic construction paths: its generic framework/system core.eventreceiver identity and an explicitly injected LogScope. EventReceiver remains a logging-free scheduling abstraction.
SocketConnection supplies its already-initialized scope to SocketReader and SocketWriter base subobjects. Address helpers and writer diagnostics use the inherited connection logger. Established TLS readers/writers and lifecycle helpers consume that same canonical scope. SocketAcceptor and SocketConnector now capture the existing connection logger for handshake failures, so those records no longer reconstruct [fd] instance identity. All TLS acceptor/connector logger calls now use socketConnection->log() directly; SocketConnectionT explicitly exposes that canonical logger with using Super::log.
ReadEventReceiver, WriteEventReceiver, and ExceptionalConditionEventReceiver now require an explicit LogScope. Pipe and MariaDB construct their canonical identity at the owner and pass it into their descriptor receiver bases. Their public owner constructors accept an optional, defaulted instance name. No endpoint or helper stores a second logger owner; the final scope copy remains in DescriptorEventReceiver. Obsolete TLS lifecycle helper constructor forms were removed, while standalone public TLS helper calls receive an explicit generic receiver scope.
Validation