Skip to content

Commit

Permalink
Merge pull request #960 from godeamon/bug/send-request-read-msg-ctx-e…
Browse files Browse the repository at this point in the history
…rr-check

add ctx canceled err check
  • Loading branch information
guillaumemichel authored Nov 28, 2023
2 parents b63ad60 + ae0987e commit ef7d2b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/net/message_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ func (ms *peerMessageSender) SendRequest(ctx context.Context, pmes *pb.Message)
if err := ms.ctxReadMsg(ctx, mes); err != nil {
_ = ms.s.Reset()
ms.s = nil

if err == context.Canceled {
// retry would be same error
return nil, err
}
if retry {
logger.Debugw("error reading message", "error", err)
return nil, err
Expand Down

0 comments on commit ef7d2b1

Please sign in to comment.