From 2e835828b520864c49cd2771de9505156854e75c Mon Sep 17 00:00:00 2001 From: Paulo Neves Date: Fri, 18 Mar 2022 10:57:34 +0100 Subject: [PATCH] client.go Remove Disconnect()'s wait on c.commsStopped. 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. --- client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 4c869f1..f0ac221 100644 --- a/client.go +++ b/client.go @@ -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") }