Skip to content

Narrow socket semantic logging scope - #233

Merged
VolkerChristian merged 5 commits into
masterfrom
agent/narrow-socket-semantic-scope
Aug 16, 2026
Merged

Narrow socket semantic logging scope#233
VolkerChristian merged 5 commits into
masterfrom
agent/narrow-socket-semantic-scope

Conversation

@VolkerChristian

@VolkerChristian VolkerChristian commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

  • establish the owning SocketConnection semantic scope during SocketReader/SocketWriter construction
  • keep generic DescriptorEventReceiver users on framework/system core.eventreceiver identity
  • remove legacy reader/writer display identity from established socket logs
  • propagate canonical connection scope through TLS readers, writers, handshake, and shutdown helpers
  • route TLS acceptor/connector handshake failures through the owning connection logger
  • use direct, type-safe SocketConnection logger access without redundant base-class casts
  • require explicit semantic scope construction for ReadEventReceiver, WriteEventReceiver, and ExceptionalConditionEventReceiver
  • give Pipe endpoints framework/connection core.pipe identity with an optional API instance name and logical pipe ID
  • give MariaDB connections framework/connection db.mariadb identity with an optional API instance name and configured logical connection name
  • retain SocketServer/SocketClient lifecycle messages as instance-scoped child-connection events

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

  • tests-enabled configure: passed
  • full build: passed
  • focused semantic/Pipe/socket/TLS tests: 30/30 passed
  • final TLS-focused tests: 15/15 passed
  • full CTest: 181/181 passed
  • git diff --check: passed
  • searches confirm core TLS logging no longer combines getConnectionName with ssl_log
  • searches confirm SocketAcceptor and SocketConnector contain no redundant SocketConnection logger casts
  • runtime assertions verify established connection logs use framework/connection core.socket.stream inst/role/conn, contain no [fd] instance, generic receivers retain framework/system core.eventreceiver, and named Pipe endpoints use framework/connection core.pipe with a logical connection ID

@VolkerChristian
VolkerChristian marked this pull request as ready for review August 16, 2026 17:58
@VolkerChristian
VolkerChristian merged commit bc43179 into master Aug 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant