Skip to content

chore: update ipfs-http-client to the latest version #23

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

Merged
merged 2 commits into from
Apr 9, 2020

Conversation

achingbrain
Copy link
Member

No description provided.

@achingbrain
Copy link
Member Author

Depends on ipfs/js-ipfs#2965

Comment on lines +52 to +54
searchParams: {
timeout: `${options.timeout}ms`// The api requires specification of the time unit (s/ms)
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
searchParams: {
timeout: `${options.timeout}ms`// The api requires specification of the time unit (s/ms)
}
timeout: options.timeout

i was looking into this in vasco's PR and the string timeout doesn't work correctly for some reason.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, are you sure? Against go-ipfs:

$ time curl http://localhost:5001/api/v0/dag/get?arg=/ipfs/QmaA9foTB68jrGgP3dBcyc8nrjbfAji8xrJsrJYo22BiVo\&timeout=5s
{"Message":"failed to get block for QmaA9foTB68jrGgP3dBcyc8nrjbfAji8xrJsrJYo22BiVo: context deadline exceeded","Code":0,"Type":"error"}

real	0m5.044s
user	0m0.006s
sys	0m0.015

$ time curl http://localhost:5001/api/v0/dag/get?arg=/ipfs/QmaA9foTB68jrGgP3dBcyc8nrjbfAji8xrJsrJYo22BiVo\&timeout=5000

real	0m0.057s
user	0m0.007s
sys	0m0.014s

$ time curl http://localhost:5001/api/v0/dag/get?arg=/ipfs/QmaA9foTB68jrGgP3dBcyc8nrjbfAji8xrJsrJYo22BiVo\&timeout=1

real	0m0.048s
user	0m0.007s
sys	0m0.017s

$ ipfs dag get /ipfs/QmaA9foTB68jrGgP3dBcyc8nrjbfAji8xrJsrJYo22BiVo --timeout 1
Error: time: missing unit in duration 1

Copy link
Member

Choose a reason for hiding this comment

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

i was talking about the client timeout, with string the tests timeout instantly with number they run.

Copy link
Member

Choose a reason for hiding this comment

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

Context: #25

I did not re-try this yet with the fix hugo's recommended

Copy link
Member Author

@achingbrain achingbrain Apr 9, 2020

Choose a reason for hiding this comment

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

I think when these tests were written, we only had timeouts in a few HTTP method calls - the argument here is for the remote node, I think.

We could do both and set the timeout in the client and the server, but that could make it non-deterministic, unless we don't inspect which timeout was the one that timed out..

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we should perform set the timeout for the client and allow the cancel of that to cause the remote context to close. It sounds like there are some downstream issues with this at the moment though, so for now we can use the remote timeout to get around this until context cancelling is working appropriately.

We could do both and set the timeout in the client and the server

Definitely want to avoid that, it would be a nightmare to deal with.

@jacobheun jacobheun merged commit 67536b4 into master Apr 9, 2020
@jacobheun jacobheun deleted the chore/update-ipfs-http-client-and-other-deps branch April 9, 2020 10:44
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.

4 participants