-
Notifications
You must be signed in to change notification settings - Fork 604
Open
Description
In reference to:
To me the use of shutdownLock seems a bit suspect, as it seems to only prevent concurrent attempts to Close(),
which writes to bool variable "shutdown",
but does not protect calls to "IsClosed()", and all checks in the rpc_client.go code do not even go through IsClosed, they check directly
c.shutdown .
Compounding to this, the Close() function only closes after setting c.shutdown to true:
if !c.shutdown {
c.shutdown = true
close(c.shutdownCh)
c.deregisterAll()
return c.conn.Close()
}
So it seems very much possible for code checking for IsClosed() to return true when it is not.
I would suggest to protect IsClosed using the shutdown mutex too,
and call into IsClosed() everywhere is rpc_client.go instead of checking c.shutdown directly.
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels