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

Skip to content

Conversation

@applejag
Copy link

@applejag applejag commented May 9, 2025

What this PR does:

  • Fixes TCPTransportConfig getting overridden in the ring/example/local example code

Which issue(s) this PR fixes:

none

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

For context I was trying to use the ring example and was having issues with the following log messages:

Refuting a suspect message (from: 127.0.0.1-7a3fd3a1)
Suspect 127.0.0.1-7a3fd3a1 has failed, no acks received

Enabling debug logs showed some more juicy info:

level=debug component=memberlist component="memberlist TCPTransport" msg="WriteTo failed to acquire a writer. Dropping message" timeout=0s addr=127.0.0.1:7947
level=debug component=memberlist component="memberlist TCPTransport" msg="WriteTo failed to acquire a writer. Dropping message" timeout=0s addr=127.0.0.1:7947
level=debug component=memberlist component="memberlist TCPTransport" msg="WriteTo failed to acquire a writer. Dropping message" timeout=0s addr=127.0.0.1:7947

The weird thing is that this only occurred on Go 1.23.0+. The example still specifies 1.22.0 where the bug was not present. To reproduce just change the Go version:

diff --git a/ring/example/local/go.mod b/ring/example/local/go.mod
index b72cd79..2d62f84 100644
--- a/ring/example/local/go.mod
+++ b/ring/example/local/go.mod
@@ -1,6 +1,6 @@
 module github.com/grafana/dskit/ring/example/local

-go 1.22.0
+go 1.23.0

 toolchain go1.24.2

The errornous example set the timeout (TCPTransportConfig.AcquireWriterTimeout) to write a broadcast message to zero, which behaved differently between Go 1.22 and 1.23.

But now the example doesn't override the example anymore and works in both 1.22 and later.

@CLAassistant
Copy link

CLAassistant commented May 9, 2025

CLA assistant check
All committers have signed the CLA.

@fgouteroux
Copy link

@applejag I was getting the same issue after upgrading the lib version. Thanks for the PR, it resolve my issue.

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.

3 participants