Skip to content

Commit 0035aa5

Browse files
committed
fix: add return when receive unexpected error
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
1 parent 9638fba commit 0035aa5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,14 +551,13 @@ func (c *serverConn) run(sctx context.Context) {
551551
// TODO(stevvooe): Not wildly clear what we should do in this
552552
// branch. Basically, it means that we are no longer receiving
553553
// requests due to a terminal error.
554-
recvErr = nil // connection is now "closing"
555554
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, syscall.ECONNRESET) {
556555
// The client went away and we should stop processing
557556
// requests, so that the client connection is closed
558557
return
559558
}
560559
log.G(ctx).WithError(err).Error("error receiving message")
561-
// else, initiate shutdown
560+
return
562561
case <-shutdown:
563562
return
564563
}

0 commit comments

Comments
 (0)