Commit Graph

67 Commits

Author SHA1 Message Date
Ben Newman
90ece32013 Fix problems in request callback that broke getUrlWithResuming tests. 2016-10-17 15:19:21 -04:00
Ben Newman
30aec9f345 Report an error when HTTP request body is incomplete.
When a download aborts prematurely, the status code is often 200 OK, even
though we probably should not proceed with any further processing of the
downloaded information.

This silent failure leads to problems like the dreaded "Error: ENOENT: no
such file or directory, open... os.json" (#7806 and others), which were
hard to diagnose properly because the failure occurred only later, when
extracting a buffer that downloaded incompletely.

The getUrlWithResuming helper should be able to retry after this error is
thrown, which will result in a more helpful warning, even if in the most
common case, i.e. MaxCDN failure, it will never actually succeed.

Note that this change will not help until Meteor 1.4.2 is officially
released and becomes the implementation used to download later releases.

Mitigates #7806.
2016-10-17 13:52:53 -04:00
Ben Newman
bb8e1a3b9f Implement ConcatStream class instead of using concat-stream npm package. 2016-08-01 14:42:22 -04:00
Tom Coleman
7769951ee8 Switched to concat-stream for performance 2016-08-01 17:55:37 +10:00
Ben Newman
e85cef8e1a Make download resumption test faster and more deterministic.
We now use a smaller file (the `babel-compiler` archive instead of
`meteor-tool`), and we interrupt every 500kB, which leads to three total
interruptions for that file. Also, we only delay one second (instead of
five) between attempts.
2016-07-14 17:00:08 -04:00
Ben Newman
91f203999b Make download resumption test always run (and pass).
This is a test that really needs to run and pass every time we run the
test suite, so I decided it shouldn't be --slow. If it takes too long, we
can always download a smaller test file.

Hard-coding the download length was a recipe for brittleness, so now I'm
downloading the file without interruptions in parallel with the
interrupted/resumed download, so that we can compare the two files when
both have finished downloading.

Follow-up to #7399.
2016-07-14 16:05:35 -04:00
Ben Newman
0c43039f60 Avoid fiberHelpers.bindEnvironment by returning Promise from attempt.
Follow-up to #7399.
2016-07-14 11:47:32 -04:00
Ben Newman
fbfb5b84e2 Avoid exposing httpHelpers._currentRequest.
Follow-up to #7399.
2016-07-14 11:47:32 -04:00
Tom Coleman
2cb3462b6d Minor fixes + added a comment 2016-07-14 11:47:32 -04:00
Tom Coleman
4a28c33dd7 Better logging and progress
Using Console.debug to register messages about retries.
2016-07-14 11:47:31 -04:00
Tom Coleman
36011459fa Made the test work in a sensible way 2016-07-14 11:47:31 -04:00
Tom Coleman
cc07c15b6b First pass at request resuming via buffering the range header
This is still a WIP, but I wanted to get feedback at this point.
Will update the PR with outstanding TODOs.
2016-07-14 11:47:30 -04:00
Ben Newman
e90ce88b0e Fix a bug in tools/utils/http-helpers.js. 2016-07-14 11:27:58 -04:00
Ben Newman
df77c39908 Bump default HTTP timeout to 60 seconds, and allow disabling. 2016-06-23 11:49:23 -04:00
Zoltan Olah
8f86d08827 Merge pull request #7143 from mitar/timeouts
Set timeout for HTTP requests
2016-06-22 08:59:38 +10:00
Mitar
3846c6f45c Changed timeout 30 seconds as instructed by our god Math.random(). 2016-06-16 23:12:08 -07:00
Ben Newman
dce2b20ddb Merge pull request #7033 from meteor/release-1.3.3
Release 1.3.3
2016-06-10 18:18:28 -04:00
chemicstry
512799ed9e Initial IPv6 support 2016-06-06 02:17:36 +03:00
Mitar
853e218a89 Set timeout for HTTP requests. 2016-05-31 23:35:46 +02:00
Ben Newman
d94e7d812d Upgrade dev bundle meteor-promise to 0.7.1. 2016-05-16 18:21:11 -04:00
Tom Coleman
15db86ec3e Minor cleanup 2016-05-05 16:32:10 -07:00
Tom Coleman
88ed8e289a Use longjohn to repair stacktraces on self-test 2016-05-05 15:05:52 -07:00
Tom Coleman
4056111acb Use longjohn to repair stacktraces on self-test 2016-05-05 14:42:05 -07:00
Martijn Walraven
743b740359 Add a trailing slash in utils.formatUrl for consistency with Meteor.absoluteUrl 2016-02-24 12:55:26 +01:00
Martijn Walraven
99e58d72a0 Support modern Cordova whitelist mechanism 2016-01-25 15:02:39 -08:00
Steven Edouard
fd83e399fe Launch processes in a Windows-friendly way
- options.cwd passed through convertToOSPath
- launch processes on Windows using child_process.exec
- parse args for windows into space-delimited string
2016-01-25 15:02:02 -08:00
Ben Newman
f7b2735d23 Reimplement fiberHelpers.parallelEach without explicit Fibers. 2015-12-09 12:06:52 -05:00
Ben Newman
79f82911d0 Avoid having to use Fibers explicitly in buildmessage.forkJoin. 2015-12-09 12:06:52 -05:00
Ben Newman
3cafbc72ac Use async functions to eliminate the need for fiberHelpers.inBareFiber.
The comments for inBareFiber claim that it's for times when you don't want
to inherit the dynamic environment variables of the current Fiber, but
none of the call sites actually relied on this behavior. Still, it may be
worth noting that async functions automatically (and cheaply) inherit the
calling Fiber's dynamics, which is virtually always what you want.
2015-12-09 12:06:51 -05:00
Ben Newman
2d8fbb6c79 Eliminate Future-related utilities from tools/fiber-helpers.js. 2015-12-09 12:06:51 -05:00
Ben Newman
d54410db8e Eliminate Future from tools/service-connection.js. 2015-12-09 12:06:48 -05:00
Ben Newman
7f0156f273 Eliminate Future from tools/http-helpers.js. 2015-12-09 12:06:47 -05:00
Ben Newman
15ef3884cc Eliminate Future from tools/utils.js. 2015-12-09 12:06:46 -05:00
Ben Newman
c815a5b534 Eliminate Future from tools/buildmessage.js. 2015-12-09 12:06:46 -05:00
Tom Coleman
705a7eda1a Switch the semantics - forNpm -> forCordova
Cordova uses npm but is *more* specific so this is less potentially confusing.
2015-11-25 16:27:36 +11:00
Tom Coleman
54396f78b7 Switch semantics to isValidVersion 2015-11-25 16:27:36 +11:00
Tom Coleman
81fff25ecb Don't require npm URLs to have a #commit-ish
Npm says it will default to `master`. That's OK by us.
2015-11-25 16:27:35 +11:00
Tom Coleman
222115665b Refactored isExactVersionto handle npm/cordova
See https://github.com/meteor/meteor/pull/5562/files for a discussion. Basically Cordova doesn't really support

a) Urls with @'s in them
b) Urls that don't point to fixed commits.

As this branch allows both of the above (and our NPM support does reasonably handle a+b), we split the way we handle cordova + npm URLs a little.
2015-11-25 16:27:35 +11:00
Tom Coleman
58cbe65060 Allow the other types of URLs that npm supports.
See for instance #844 for people running into the
fact that our lack of support for git protocols means
dealing with private npm packages is a pain.
2015-11-25 16:27:11 +11:00
Ben Newman
ed17924940 Add braces to every if/for(-in)/while statement in tools directory. 2015-11-13 12:25:19 -05:00
Blake Bourque
0aa1291fd6 Patch to allow users to override root cert list
Fixes #4757
Uses environment variable CAFILE (to match NPM) which must contain a fully qualified path to a pem format root certificate to include in the list of trusted root certs.

This additional root certificate will be needed for those behind an SSL inspection proxy which acts as an SSL termination point and resigns the traffic with its own root certificate.
2015-10-27 13:39:18 -07:00
Martijn Walraven
76bb1a183e Make buildmessage.exception() deal with the case where an error has no stack trace 2015-09-24 12:03:51 +02:00
Sashko Stubailo
550489cea8 Intelligently decide which stack trace to use 2015-09-14 17:51:43 -07:00
Sashko Stubailo
e2d4556479 Special-case http imports in LESS package 2015-09-14 11:53:58 -07:00
Martijn Walraven
b274e5390a Fix bug in execFileAsync that meant options were ignored without args 2015-09-11 18:44:17 +02:00
Martijn Walraven
0ea336424a Clarify some comments 2015-08-26 19:26:57 +02:00
Martijn Walraven
b2c5ff4d5a Allow specifying a destination option for execFileSync/Async
If specified, instead of capturing the output, the child process stdout
will be piped to the destination stream.

Although the standard spawn stdio option lets you pass in streams,
these have to be connected to an open file descriptor. The destination
option allows you to use any Writable, so it can be used with a
Transform for instance.
2015-08-26 19:26:55 +02:00
Martijn Walraven
63461fcd8f Remove unused RunCommand and add promise-based execFileSync/Async
The execFileSync function is meant to resemble the similarly-named Node
0.12 synchronous process creation API, but instead of being fully
blocking it uses a promise-based implementation. You can also use
execFileAsync directly, which returns a promise.

Some functionality is currently missing but could be added when the
need arises (e.g. support for timeout, maxBuffer, and encoding options).

Eventually, these versions should replace the ones in
tools/utils/utils.js and tools/tool-testing/selftest.js.
2015-08-26 19:26:54 +02:00
Martijn Walraven
b03455f382 Re-enable netroute for platforms other than win32 2015-08-26 19:26:52 +02:00
Martijn Walraven
87b11bdab5 Cordova refactoring and change of runner behavior
- Refactored code in tools/cordova and introduced CordovaBuilder and
CordovaRunTarget classes
- CordovaRunner now builds and runs the project as part of the main
runner loop
- Some code cleanup and ES2015 conversions
2015-08-26 19:26:49 +02:00