Skip to content
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

Add timeout #351

Merged
merged 2 commits into from
Jun 30, 2019
Merged

Add timeout #351

merged 2 commits into from
Jun 30, 2019

Conversation

michaelavila
Copy link
Contributor

We noticed some odd behavior around the provide call ipfs/go-ipfs-provider#8

// run it!
res, err := query.Run(ctx, tablepeers)
res, err := query.Run(timedCtx, tablepeers)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien is this what you're talking about?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! If we want to get fancy, we could even get the deadline from the context and subtract 1(?) second (we should be connected to the closest peers when this command returns.

Yay for arbitrary constants!

@Stebalien Stebalien changed the title [DO NOT REVIEW][WIP]Add timeout Add timeout Jun 29, 2019
@Stebalien Stebalien marked this pull request as ready for review June 29, 2019 10:42
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will strictly improve things for now.

@whyrusleeping
Copy link
Contributor

Wait, why don't we just make sure callers pass a timeout?

Copy link
Contributor

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, we can make the timeouts better later, as steb says

@Stebalien Stebalien merged commit 3c72a7c into master Jun 30, 2019
@Stebalien Stebalien deleted the fix/hanging-provide branch June 30, 2019 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants