Skip to content

Commit

Permalink
mcs, tso: fix stream Send() and CloseSend() data race issue in TSO pr…
Browse files Browse the repository at this point in the history
…oxy (#6591)

close #6590

No need to call SendClose(), because TSO proxy will cancel the stream context which will cause the corresponding grpc stream on the server side to exit.

Signed-off-by: Bin Shi <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
binshi-bing and ti-chi-bot[bot] committed Jun 13, 2023
1 parent 7239173 commit 7158cb3
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,6 @@ func (s *GrpcServer) forwardTSO(stream pdpb.PD_TsoServer) error {
)
defer func() {
s.concurrentTSOProxyStreamings.Add(-1)
if forwardStream != nil {
forwardStream.CloseSend()
}
// cancel the forward stream
if cancel != nil {
cancel()
Expand Down Expand Up @@ -452,9 +449,6 @@ func (s *GrpcServer) forwardTSO(stream pdpb.PD_TsoServer) error {
return errors.WithStack(ErrNotFoundTSOAddr)
}
if forwardStream == nil || lastForwardedHost != forwardedHost {
if forwardStream != nil {
forwardStream.CloseSend()
}
if cancel != nil {
cancel()
}
Expand Down

0 comments on commit 7158cb3

Please sign in to comment.