Skip to content

Commit c6a3ace

Browse files
author
zhangfangjie
committed
fix: concurrent map writes (#861)
Add your commit body here
1 parent 6792e63 commit c6a3ace

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

common/remote/rpc/rpc_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ func (r *RpcClient) registerServerRequestHandlers() {
381381
func (r *RpcClient) Shutdown() {
382382
atomic.StoreInt32((*int32)(&r.rpcClientStatus), (int32)(SHUTDOWN))
383383
r.closeConnection()
384+
cMux.Lock()
384385
delete(clientMap, r.name)
386+
cMux.Unlock()
385387
}
386388

387389
func (r *RpcClient) RegisterServerRequestHandler(request func() rpc_request.IRequest, handler IServerRequestHandler) {

0 commit comments

Comments
 (0)