Skip to content

Commit 99a8bcc

Browse files
committed
fix context canceled recv error handling
Signed-off-by: Kuromesi <[email protected]>
1 parent 432f5ed commit 99a8bcc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/epp/handlers/server.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package handlers
1818

1919
import (
2020
"context"
21-
"errors"
2221
"io"
2322
"time"
2423

@@ -90,9 +89,13 @@ func (s *Server) Process(srv extProcPb.ExternalProcessor_ProcessServer) error {
9089
}
9190

9291
req, recvErr := srv.Recv()
93-
if recvErr == io.EOF || errors.Is(recvErr, context.Canceled) {
92+
if recvErr == io.EOF {
9493
return nil
9594
}
95+
if status.Code(recvErr) == codes.Canceled {
96+
logger.V(logutil.DEBUG).Info("request context canceled")
97+
return recvErr
98+
}
9699
if recvErr != nil {
97100
// This error occurs very frequently, though it doesn't seem to have any impact.
98101
// TODO Figure out if we can remove this noise.

0 commit comments

Comments
 (0)