Skip to content

Commit 3c0cdff

Browse files
authored
state.go: log the timeout value on a ping timeout (#153)
This will help users' troubleshooting Signed-off-by: NODA, Kai <nodakai@gmail.com>
1 parent 0bff309 commit 3c0cdff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

state.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,11 @@ HANDLE_REMOTE_FAILURE:
449449
defer close(fallbackCh)
450450
didContact, err := m.sendPingAndWaitForAck(node.FullAddress(), ping, deadline)
451451
if err != nil {
452-
m.logger.Printf("[ERR] memberlist: Failed fallback ping: %s", err)
452+
var to string
453+
if ne, ok := err.(net.Error); ok && ne.Timeout() {
454+
to = fmt.Sprintf("timeout %s: ", probeInterval)
455+
}
456+
m.logger.Printf("[ERR] memberlist: Failed fallback ping: %s%s", to, err)
453457
} else {
454458
fallbackCh <- didContact
455459
}

0 commit comments

Comments
 (0)