Revert "wgengine/magicsock: shortcircuit discoEndpoint.heartbeat when its connection is closed"

This reverts commit 08baa17d9a785635891c3462d01e601759b8b8b6.
It caused deadlocks due to lock ordering violations.
It was not the right fix, and thus should simply be reverted
while we look for the right fix (if we haven't already found it
in the interim; we've fixed other logging-after-test issues).

Fixes #1161
This commit is contained in:
Josh Bleecher Snyder 2021-01-19 11:44:32 -08:00
parent e4c075cd95
commit 5fe5402fcd

View File

@ -2259,13 +2259,6 @@ func (c *Conn) Close() error {
return err
}
// isClosed reports whether c is closed.
func (c *Conn) isClosed() bool {
c.mu.Lock()
defer c.mu.Unlock()
return c.closed
}
func (c *Conn) goroutinesRunningLocked() bool {
if c.endpointsUpdateActive {
return true
@ -2997,10 +2990,6 @@ func (de *discoEndpoint) heartbeat() {
de.heartBeatTimer = nil
if de.c.isClosed() {
return
}
if de.lastSend.IsZero() {
// Shouldn't happen.
return