Skip to content

Commit

Permalink
add ctx canceled err check
Browse files Browse the repository at this point in the history
  • Loading branch information
godeamon committed Nov 21, 2023
1 parent b63ad60 commit 12fcd27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/net/message_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,10 @@ func (ms *peerMessageSender) SendRequest(ctx context.Context, pmes *pb.Message)

mes := new(pb.Message)
if err := ms.ctxReadMsg(ctx, mes); err != nil {
_ = ms.s.Reset()
ms.s = nil
if err != context.Canceled {
_ = ms.s.Reset()
ms.s = nil
}

if retry {
logger.Debugw("error reading message", "error", err)
Expand Down

0 comments on commit 12fcd27

Please sign in to comment.