client: make use of shutdownLock on Read access#784
client: make use of shutdownLock on Read access#784hw-claudio wants to merge 1 commit intohashicorp:masterfrom
Conversation
c.shutdownLock protects access to c.shutdown, but before this commit this is only used when calling Close(), thus only protecting against parallel user calls to Close(), but it was not used when checking whether the channel is shutdown in the exported function IsClosed(), potentially returning an incorrect value. It was also not used in send() and listen(). To address this, turn the c.shutdownLock Mutex into a RWMutex, and make use of it in all these cases, enabling use of the same RPCClient from multiple parallel goroutines. Fixes: hashicorp#782 Signed-off-by: Claudio Fontana <cfontana@suse.de>
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Claudio Fontana seems not to be a GitHub user. Have you signed the CLA already but the status is still pending? Recheck it. |
1 similar comment
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Claudio Fontana seems not to be a GitHub user. Have you signed the CLA already but the status is still pending? Recheck it. |
|
signed the agreement |
c.shutdownLock protects access to c.shutdown,
but before this commit this is only used when calling Close(), thus only protecting against parallel user calls to Close(),
but it was not used when checking whether the channel is shutdown in the exported function IsClosed(), potentially returning an incorrect value.
It was also not used in send() and listen().
To address this, turn the c.shutdownLock Mutex into a RWMutex, and make use of it in all these cases, enabling use of the same RPCClient from multiple parallel goroutines.
Fixes: #782