-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Set timeout for HTTP requests #7143
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
Conversation
This might sounds too short for people in China, as in most cases it spends more than 30s. We should have a ENV to disable timeout. |
@laosb The |
Didn't realize it. Was that env used in other places? |
Also, timeout is not to download a file, but more or less timeout between TCP packets. I do not think that you have 15 seconds between packets even in China. :-) |
Ah, my mistake, sorry! |
I hoped that my comment in the code is conveying this. :-( Should I improve it? |
I thought it was fine – in general when talking about HTTP "timeout" this is what is implied – it's never the overall duration of the download, but instead the max time between blocks of data. My only concern is if this is an appropriate use of |
I also think all future ENV variables should be prefixed with |
And we should have a cheatsheet for ENVs. |
I do not know, I can remove it. I do not see really a reason for anyone to increase it to more than 15 seconds anyway. |
We should not remove it, as nobody knows who will need it. |
I think this I'd probably wait to see about using Based on the networking problems I've seen so far (including CDN problems, etc.) I think a procedure for HTTP request retry strategies is the next thing that might need some attention. |
I think we should merge it with 15 seconds, and provide it with a release candidate. And then see what people give feedback on. |
But yes, it could also be longer. I just do not want cases like now where it just hangs indefinitely. |
Definitely don't want infinite hanging. My vote would be 60 – too short of a timeout and this could actually increase the number of package install problems by terminating them when they still might succeed if left to wait. |
Shall we ask our friend > Math.round(Math.random() * 45 + 15)
35 In all seriousness, I'm subjectively comfortable with 30 seconds. |
And should I just remove the scaling and make it 30s and this is it? |
Yeah let's make it 30 seconds, and keep the scaling factor unless there's a good reason to remove it. |
Others said that until now scaling factor is used only for testing. |
Lgtm, thanks @mitar |
I'm getting the following error when I try to deploy to Galaxy with 1.3.4
Could this be related or is Galaxy simply having issues? Edit: Setting |
For who is reading the above comment; It has been comfirmed that this caused the deploy issue. A fix will be released soon. See this thread for details: https://forums.meteor.com/t/1-3-4-breaks-galaxy-deployment-etimedout/25383/7 |
Can some explain how to change the TIMEOUT_SCALE_FACTOR. Is this a variable stored somewhere, can it be done from the terminal? |
On Mac/Linux: TIMEOUT_SCALE_FACTOR=10 meteor deploy ... On Windows (PowerShell): $env:TIMEOUT_SCALE_FACTOR = "10"
meteor deploy ... |
Unfortunately, even 60s got an exceed in China. Changing TIMEOUT_SCALE_FACTOR... |
For downloading or uploading? I think the solution is to restart. Not to extend timeout. With such long delays between TCP packets, TCP connection might not recover anyway. |
Downloading. Retried several times. |
An auto-retry-and-resume strategy would make Meteor usable in China, I think. |
Care of trying to add this feature to request library? |
I seems to be getting a similar issue with Meteor 1.3.5.1 I have tried TIMEOUT_SCALE_FACTOR = "10" but I cannot consistently deploy to Galaxy |
due to successive tries to publish the package onto Atmosphere. Turns out there was a simple timeout problem, fixed by increasing that timeout with command `TIMEOUT_SCALE_FACTOR=10 meteor publish`. See meteor/meteor#7143 and https://forums.meteor.com/t/1-3-4-breaks-galaxy-deployment-etimedout/25383/17 But in the first place, it is VERY strange that Meteor needs to build and upload a few MB for such a simple package… mys:fonts package does not need to download such a big payload when installed on a project. To be investigated later on. Might be a change in Meteor behaviour.
What is the |
While debugging #7090 I discovered that there is no timeout specified for many HTTP requests Meteor is making. This means that when packaging server (or CDN) is badly behaving, client is waiting indefinitely instead of throwing an error.