Skip to content

fix: Ensure tcpGatedMaListener wrapping on both metrics and non-metri…#3275

Merged
sukunrt merged 1 commit intolibp2p:masterfrom
GarmashAlex:hpp1
May 26, 2025
Merged

fix: Ensure tcpGatedMaListener wrapping on both metrics and non-metri…#3275
sukunrt merged 1 commit intolibp2p:masterfrom
GarmashAlex:hpp1

Conversation

@GarmashAlex
Copy link
Contributor

…cs paths

This commit fixes the TCP listener wrapping issue identified in the TODO comment.
Previously, the tcpGatedMaListener was only being applied when metrics were
enabled, but it should be applied consistently on both paths.

The fix ensures that the TCP-specific configurations (such as linger and keepalive
settings) are always applied regardless of whether metrics are enabled, by:

  1. Creating a tcpGatedMaListener wrapper first
  2. Conditionally adding metrics tracing only when enabled
  3. Using the properly wrapped listener in both code paths

This change maintains the same functionality but makes behavior consistent
between metrics-enabled and metrics-disabled configurations, resolving the TODO.

@sukunrt
Copy link
Member

sukunrt commented May 16, 2025

Thanks @GarmashAlex. Apologies for the very late review.

@sukunrt sukunrt merged commit 853011a into libp2p:master May 26, 2025
10 of 11 checks 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.

2 participants