nacos-sdk-go icon indicating copy to clipboard operation
nacos-sdk-go copied to clipboard

[BUG] run into panic when service push data with custom request header.

Open brotherlu-xcq opened this issue 10 months ago • 0 comments

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

master branch.

What version of nacos-sever are you using?

custom server.

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

1.18

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

windows

What did you do?

If possible, provide a recipe for reproducing the error. server put a field in request header to client.

panic: assignment to entry in nil map

goroutine 52 [running]:
github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc/rpc_request.(*Request).PutAllHeaders(0xc000324978, 0xc00037ea20)
	D:/opensource/nacos-sdk-go/common/remote/rpc/rpc_request/rpc_request.go:43 +0xd4
github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc.(*GrpcClient).handleServerRequest(0xc0001887e0, 0xc000278c30, 0xc000315140)
	D:/opensource/nacos-sdk-go/common/remote/rpc/grpc_client.go:258 +0x477
github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc.(*GrpcClient).bindBiRequestStream.func1()
	D:/opensource/nacos-sdk-go/common/remote/rpc/grpc_client.go:204 +0x6ad
created by github.com/nacos-group/nacos-sdk-go/v2/common/remote/rpc.(*GrpcClient).bindBiRequestStream
	D:/opensource/nacos-sdk-go/common/remote/rpc/grpc_client.go:179 +0xd4

What did you expect to see?

work normally

What did you see instead?

panic.

brotherlu-xcq avatar Mar 29 '24 08:03 brotherlu-xcq