Skip to content

Commit

Permalink
client.go Remove Disconnect()'s wait on c.commsStopped.
Browse files Browse the repository at this point in the history
c.commsStopped may be overwritten in another thread than where Disconnect()
is called leading to a race. Lets temporarily remove this warning/short circuit
until we can fix underlying race issue.
  • Loading branch information
ptsneves committed Mar 18, 2022
1 parent eaac59b commit 2e83582
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ func (c *client) Disconnect(quiesce uint) {
DEBUG.Println(CLI, "calling WaitTimeout")
dt.WaitTimeout(time.Duration(quiesce) * time.Millisecond)
DEBUG.Println(CLI, "WaitTimeout done")
case <-c.commsStopped:
WARN.Println("Disconnect packet could not be sent because comms stopped")
// Let's comment this chunk of code until we are able to safely read this variable
// without data races.
// case <-c.commsStopped:
// WARN.Println("Disconnect packet could not be sent because comms stopped")
case <-time.After(time.Duration(quiesce) * time.Millisecond):
WARN.Println("Disconnect packet not sent due to timeout")
}
Expand Down

0 comments on commit 2e83582

Please sign in to comment.