Skip to content

Commit

Permalink
Merge pull request #590 from ptsneves/pneves-disconnect-workaround
Browse files Browse the repository at this point in the history
client.go Remove Disconnect()'s wait on `c.commsStopped` (preventing potential race)
  • Loading branch information
MattBrittan authored Mar 19, 2022
2 parents eaac59b + 2e83582 commit 8717376
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 8717376

Please sign in to comment.