grpc / grpc-go

The Go language implementation of gRPC. HTTP/2 based RPC
https://grpc.io
Apache License 2.0
20.9k stars 4.34k forks source link

panic: send on closed channel #7630

Open chenchengfa93 opened 1 week ago

chenchengfa93 commented 1 week ago

What version of gRPC are you using?

1.59.0

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

go1.19.10 linux/amd64

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

Linux Docker container based on centos7

What did you do?

There haven't been any changes,this version of go-grpc and go version is no update at least six month, and the code running well for at least a month, but suddenly reporting this panic

What did you expect to see?

Find the cause of the problem and fix it

What did you see instead?

goroutine 55203508 [running]:
google.golang.org/grpc/internal/transport.(*recvBuffer).put(0xc011ac6400, {0xc00541ddd0?, {0x0?, 0x0?}})
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/internal/transport/transport.go:111 +0xfe
google.golang.org/grpc/internal/transport.(*Stream).write(...)
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/internal/transport/transport.go:480
google.golang.org/grpc/internal/transport.(*http2Server).handleData(0xc01552b040, 0xc01185ef00)
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/internal/transport/http2_server.go:809 +0x365
google.golang.org/grpc/internal/transport.(*http2Server).HandleStreams(0xc01552b040, 0x1?)
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/internal/transport/http2_server.go:672 +0x2e5
google.golang.org/grpc.(*Server).serveStreams(0xc000af2780, {0x1ab7ea0?, 0xc01552b040})
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:979 +0x1e2
google.golang.org/grpc.(*Server).handleRawConn.func1()
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:920 +0x46
created by google.golang.org/grpc.(*Server).handleRawConn
    /go/pkg/mod/google.golang.org/grpc@v1.59.0/server.go:919 +0x185
eshitachandwani commented 3 days ago

@chenchengfa93 thanks for reaching out and reporting this issue.

We noticed you're using gRPC version v1.59. The current version is v1.66.2, which includes several bug fixes and performance improvements.

Could you please upgrade to the latest version and see if the issue persists?

If the problem continues after upgrading, please provide a reproduction test case so we can investigate further. The information provided so far isn't enough for us to debug effectively. This will help us pinpoint the exact cause of the error and provide a faster resolution.

chenchengfa93 commented 2 days ago

@eshitachandwani thanks for reply

I will try to upgrade to the latest version based on your suggestion.

But the frequency of this problem is very low, and I may not be able to reproduce it.Do you have any helpful suggestions for reproducing it