Skip to content

Commit cf87955

Browse files
author
allenzhli
committed
Merge branch 'master' of ssh://github.com/cortexproject/cortex
Signed-off-by: allenzhli <[email protected]>
2 parents bf47d11 + 8fe0bb1 commit cf87955

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

pkg/ring/kv/memberlist/tcp_transport.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ type TCPTransportConfig struct {
4949
// Timeout for writing packet data. Zero = no timeout.
5050
PacketWriteTimeout time.Duration `yaml:"packet_write_timeout"`
5151

52-
// WriteTo is used to send "UDP" packets. Since we use TCP, we can detect more errors,
53-
// but memberlist doesn't seem to cope with that very well.
54-
ReportWriteToErrors bool `yaml:"-"`
55-
5652
// Transport logs lot of messages at debug level, so it deserves an extra flag for turning it on
5753
TransportDebug bool `yaml:"-"`
5854

@@ -418,11 +414,10 @@ func (t *TCPTransport) WriteTo(b []byte, addr string) (time.Time, error) {
418414
if err != nil {
419415
t.sentPacketsErrors.Inc()
420416

421-
if t.cfg.ReportWriteToErrors {
422-
return time.Time{}, fmt.Errorf("WriteTo %s: %w", addr, err)
423-
}
424-
425417
level.Warn(t.logger).Log("msg", "TCPTransport: WriteTo failed", "addr", addr, "err", err)
418+
419+
// WriteTo is used to send "UDP" packets. Since we use TCP, we can detect more errors,
420+
// but memberlist library doesn't seem to cope with that very well. That is why we return nil instead.
426421
return time.Now(), nil
427422
}
428423

0 commit comments

Comments
 (0)