• Felix Lange's avatar
    p2p/discover: fix UDP reply packet timeout handling · 590c99a9
    Felix Lange authored
    If the timeout fired (even just nanoseconds) before the deadline of the
    next pending reply, the timer was not rescheduled. The timer would've
    been rescheduled anyway once the next packet was sent, but there were
    cases where no next packet could ever be sent due to the locking issue
    fixed in the previous commit.
    
    As timing-related bugs go, this issue had been present for a long time
    and I could never reproduce it. The test added in this commit did
    reproduce the issue on about one out of 15 runs.
    590c99a9
udp.go 16.4 KB