Skip to content

Commit

Permalink
fix stream panic
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Oct 23, 2023
1 parent e19265f commit 55dd28e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2529,6 +2529,9 @@ func forwardRegionHeartbeatClientToServer(forwardStream pdpb.PD_RegionHeartbeatC
}

func (s *GrpcServer) createSchedulingStream(client *grpc.ClientConn) (schedulingpb.Scheduling_RegionHeartbeatClient, context.CancelFunc, error) {
if client == nil {
return nil, nil, errors.New("connection is not set")
}
done := make(chan struct{})
ctx, cancel := context.WithCancel(s.ctx)
go grpcutil.CheckStream(ctx, cancel, done)
Expand Down

0 comments on commit 55dd28e

Please sign in to comment.