New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: pullsync make offer timeout #3520
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ var ( | |
|
||
const ( | ||
storagePutTimeout = 5 * time.Second | ||
makeOfferTimeout = 5 * time.Minute | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My nodes are (well, were before the stampes expired) routinely taking longer than 5 minutes to construct the offer. makeOffer's context is automatically cancelled at the end of the commit round by the agent, so why have a local timeout specified here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is puller/pullsync stuff, not reserve sampler :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duh. makeOffer, not makeSample! That's what I get for commenting before I'm fully awake. I'll blame it on Nicole, the hurricane that passed by us last night! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jeez, a bad year for florida this year! so many hurricanes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least Nicole was barely a category 1, just above a tropical storm. Amazingly, we didn't even lose power; a few blinks overnight, but no outright loss. |
||
) | ||
|
||
// how many maximum chunks in a batch | ||
|
@@ -355,6 +356,10 @@ func (s *Syncer) handler(streamCtx context.Context, p p2p.Peer, stream p2p.Strea | |
|
||
// makeOffer tries to assemble an offer for a given requested interval. | ||
func (s *Syncer) makeOffer(ctx context.Context, rn pb.GetRange) (o *pb.Offer, addrs []swarm.Address, err error) { | ||
|
||
ctx, cancel := context.WithTimeout(ctx, makeOfferTimeout) | ||
defer cancel() | ||
|
||
chs, top, err := s.storage.IntervalChunks(ctx, uint8(rn.Bin), rn.From, rn.To, maxPage) | ||
if err != nil { | ||
return o, nil, err | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious as to why the length of sleep needs to be increased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an arbitrary value, 5 seconds seemed a bit aggressive to me after some thinking