Skip to content

Fix ring local example failing getting TCP config overridden#694

Open
applejag wants to merge 1 commit into
grafana:mainfrom
applejag:bugfix/ring-example-tcp-transport
Open

Fix ring local example failing getting TCP config overridden#694
applejag wants to merge 1 commit into
grafana:mainfrom
applejag:bugfix/ring-example-tcp-transport

Conversation

@applejag

@applejag applejag commented May 9, 2025

Copy link
Copy Markdown

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

CLAassistant commented May 9, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@fgouteroux

Copy link
Copy Markdown

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

@pracucci

pracucci commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 We recently merged #947 which changed the CI configuration for unit tests. To get CI passing on this PR, please rebase on the latest main branch:

git fetch origin main
git rebase origin/main
git push --force-with-lease

Thanks!

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.

4 participants