hashicorp / hashicorp/memberlist
[bug] probeTimeout > probeInterval
- Dominant language
- Go
- Stars
- 4.1k
- Forks
- 478
- Avg merge
- 15h 58m
- Merged PRs (30d)
- 3
Description
In probNode,If the probeTimeout is greater than probeInterval, when the first udp ping failed due to probeTimeout, the TCP prob will also fail, due to reach deadline.
Shall we add a validate func to valide config, to make sure probeTimeout < probeInterval, or modify probeNode code, set the deadline when we actually do the tcp probe, like:
```golang
if (!m.config.DisableTcpPings) && (node.PMax >= 3) {
go func() {
defer close(fallbackCh)
// set the deadline when we actually do the probe
deadline := time.Now().Add(probeInterval)
didContact, err := m.sendPingAndWaitForAck(node.Address(), ping, deadline)
if err != nil {
m.logger.Printf("[ERR] memberlist: Failed fallback ping: %s", err)
} else {
fallbackCh <- didContact
}
}()
} else {
close(fallbackCh)
}
```
Contributor guide
Research direction
Start by tracing probNode and the deadline handling around the failed UDP ping and TCP fallback. Compare validating probeTimeout against probeInterval with setting the deadline when the TCP probe begins, then verify that a timed-out UDP probe no longer prevents the fallback probe from running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100