Skip to content

Commit

Permalink
state.go: log the timeout value on a ping timeout (#153)
Browse files Browse the repository at this point in the history
This will help users' troubleshooting

Signed-off-by: NODA, Kai <nodakai@gmail.com>
  • Loading branch information
nodakai committed Jan 19, 2022
1 parent 0bff309 commit 3c0cdff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion state.go
Expand Up @@ -449,7 +449,11 @@ HANDLE_REMOTE_FAILURE:
defer close(fallbackCh)
didContact, err := m.sendPingAndWaitForAck(node.FullAddress(), ping, deadline)
if err != nil {
m.logger.Printf("[ERR] memberlist: Failed fallback ping: %s", err)
var to string
if ne, ok := err.(net.Error); ok && ne.Timeout() {
to = fmt.Sprintf("timeout %s: ", probeInterval)
}
m.logger.Printf("[ERR] memberlist: Failed fallback ping: %s%s", to, err)
} else {
fallbackCh <- didContact
}
Expand Down

0 comments on commit 3c0cdff

Please sign in to comment.