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

Network timeout too aggressive #386

Closed
sergiusens opened this issue Sep 13, 2018 · 8 comments
Closed

Network timeout too aggressive #386

sergiusens opened this issue Sep 13, 2018 · 8 comments

Comments

@sergiusens
Copy link

If my network is not at its best state with regards to latency, it is rather easy to get:

$ multipass launch
failed to launch: Network timeout                                               
$ multipass launch                        
failed to launch: Network timeout

As a side data point, using snapcraft or having lxd auto trigger the new image download does not timeout like this. I have not timed it, but feels like it waits only 2 seconds to decide on a timeout.

@Saviq
Copy link
Collaborator

Saviq commented Sep 13, 2018

It looks like the simplestreams index downloader is what this bails on.

@townsend2010
Copy link
Contributor

townsend2010 commented Sep 13, 2018

It is set to be a 10 second timeout for any network activity such as fetching the SimpleStreams data or an image. If it is indeed shorter than ~10 seconds, then something strange is going on. But if it is 10 seconds, then that is some really bad latency/download bandwidth. However, maybe we need to bump up the timeout...but to what??

@sergiusens
Copy link
Author

Maybe use the same number lxd uses?

@townsend2010
Copy link
Contributor

LXD just uses whatever the Go network stuff gives it, so I'll have to dig into that stuff to figure it out.

One thing I thought of though is that we give it 10 seconds total to fully download the SimpleStreams manifest, so for high latency/low bandwidth setups, this is not optimal. I think instead, we should just detect if any progress is being made and if so, let it keep chugging along and only timeout if no progress is being made in 10 seconds (or some other arbitrary timeout).

@Saviq
Copy link
Collaborator

Saviq commented Feb 27, 2019

It is set to be a 10 second timeout for any network activity such as fetching the SimpleStreams data or an image.

url_downloader.cpp#L60 actually shows the shorthand URLDownloader(const QUrl& url) used for index downloads does not have this treatment. It will plain time out after 10s.

Should be relatively easy to replicate the behaviour of download_to(…) where it resets the timer if any data came in.

@brlin-tw
Copy link

I wonder if this issue is the same as the [error] [daemon] Error fetching image information: Network timeout error message when running multipass list?

@Saviq
Copy link
Collaborator

Saviq commented Feb 28, 2019

@Lin-Buo-Ren that is quite likely, yes, is that what you've been having trouble with snapcraft with?

@brlin-tw
Copy link

brlin-tw commented Feb 28, 2019

@Lin-Buo-Ren that is quite likely, yes, is that what you've been having trouble with snapcraft with?

Not really the same with the previous one, it just kept coming out for my attention.
It would be great if multipass can support custom image remotes as lxc remote does, but that's another issue.

@townsend2010 townsend2010 self-assigned this Mar 1, 2019
bors bot added a commit that referenced this issue Mar 4, 2019
658: downloader: Reset timer when readReady is emitted for general downloads r=ricab a=townsend2010

Fixes #386

Co-authored-by: Chris Townsend <[email protected]>
bors bot added a commit that referenced this issue Mar 4, 2019
658: downloader: Reset timer when readReady is emitted for general downloads r=ricab a=townsend2010

Fixes #386

Co-authored-by: Chris Townsend <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants