Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@marten-seemann
Copy link
Member

No description provided.

@marten-seemann marten-seemann linked an issue Nov 1, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the ConnectionClosed qlog event structure to replace error object introspection with explicit field-based representation. Instead of passing an error interface and using errors.As() to determine the type and extract details, the event now directly accepts structured fields like Initiator, ConnectionError, ApplicationError, Reason, and Trigger.

Key changes:

  • Replaced error-based ConnectionClosed event with explicit typed fields
  • Added type aliases for TransportErrorCode and ApplicationErrorCode to qlog package
  • Introduced ConnectionCloseTrigger enum for idle_timeout, application, version_mismatch, and stateless_reset scenarios
  • Updated encoding logic to use switch statements on error codes instead of error type assertions

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
qlog/types.go Added type aliases for error codes and new ConnectionCloseTrigger enum type with constants
qlog/event.go Refactored ConnectionClosed struct and encoding logic to use explicit fields instead of error introspection
qlog/event_test.go Updated tests to construct ConnectionClosed events with explicit fields; removed handshake timeout test as it's now handled same as idle timeout
connection_test.go Updated test assertions to construct expected qlog events with explicit structured fields
connection.go Modified handleCloseError to extract error details and construct qlog event with explicit fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marten-seemann marten-seemann merged commit 4930f90 into master Nov 3, 2025
47 of 48 checks passed
@marten-seemann marten-seemann deleted the qlog-connection-closed branch November 3, 2025 15:22
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.

qlog: rework ConnectionClosed event

2 participants