Skip to content

Commit 8717376

Browse files
authored
Merge pull request #590 from ptsneves/pneves-disconnect-workaround
client.go Remove Disconnect()'s wait on `c.commsStopped` (preventing potential race)
2 parents eaac59b + 2e83582 commit 8717376

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,10 @@ func (c *client) Disconnect(quiesce uint) {
471471
DEBUG.Println(CLI, "calling WaitTimeout")
472472
dt.WaitTimeout(time.Duration(quiesce) * time.Millisecond)
473473
DEBUG.Println(CLI, "WaitTimeout done")
474-
case <-c.commsStopped:
475-
WARN.Println("Disconnect packet could not be sent because comms stopped")
474+
// Let's comment this chunk of code until we are able to safely read this variable
475+
// without data races.
476+
// case <-c.commsStopped:
477+
// WARN.Println("Disconnect packet could not be sent because comms stopped")
476478
case <-time.After(time.Duration(quiesce) * time.Millisecond):
477479
WARN.Println("Disconnect packet not sent due to timeout")
478480
}

0 commit comments

Comments
 (0)