Skip to content

Commit

Permalink
p2p: fix request timeout (#5533)
Browse files Browse the repository at this point in the history
## Motivation

The context timeout for client-side P2P request code is wrong, effectively blocking the advantage of adjustable deadline.
  • Loading branch information
ivan4th committed Feb 5, 2024
1 parent cc5415a commit c2180b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (s *Server) Request(
}

func (s *Server) request(ctx context.Context, pid peer.ID, req []byte) (*Response, error) {
ctx, cancel := context.WithTimeout(ctx, s.timeout)
ctx, cancel := context.WithTimeout(ctx, s.hardTimeout)
defer cancel()

var stream network.Stream
Expand Down

0 comments on commit c2180b0

Please sign in to comment.