Skip to content

fatal error: concurrent map writes when closing multiple nacos clients in the same time #861

@jay376

Description

@jay376

What version of nacos-sdk-go are you using?

2.3.5

What version of nacos-sever are you using?

What version of Go are you using (go version)?

1.24

What operating system (Linux, Windows, …) and version?

Linux

What did you do?

If possible, provide a recipe for reproducing the error.

Image

What did you expect to see?

It should add lock when deleting the client.
func (r *RpcClient) Shutdown() {
atomic.StoreInt32((*int32)(&r.rpcClientStatus), (int32)(SHUTDOWN))
r.closeConnection()
delete(clientMap, r.name)
}

What did you see instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions