Mobrovac has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/333142 )
Change subject: Update cxserver to f3c8a19 ...................................................................... Update cxserver to f3c8a19 List of changes: f3c8a19 Update preq dependency to 0.5.2 xxxxxxx Update node module dependencies Change-Id: I3041cce63cf26b20ca7ac2a877473bbe55638bf0 --- M node_modules/heapdump/build/Makefile M node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d M node_modules/heapdump/build/addon.target.mk M node_modules/heapdump/build/config.gypi M node_modules/kad/package.json D node_modules/normalize-package-data/test/normalize.js~ M node_modules/preq/.travis.yml M node_modules/preq/index.js M node_modules/preq/package.json M node_modules/semver/package.json M node_modules/swagger-ui/package.json M src 12 files changed, 130 insertions(+), 354 deletions(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/node_modules/heapdump/build/Makefile b/node_modules/heapdump/build/Makefile index 2f27e5e..80ab260 100644 --- a/node_modules/heapdump/build/Makefile +++ b/node_modules/heapdump/build/Makefile @@ -308,8 +308,8 @@ endif quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/opt/service/node_modules/heapdump/build/config.gypi -I/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/root/.node-gyp/6.9.1/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/root/.node-gyp/6.9.1" "-Dnode_gyp_dir=/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp -Makefile: $(srcdir)/../../../../usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../root/.node-gyp/6.9.1/include/node/common.gypi +cmd_regen_makefile = cd $(srcdir); /usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/opt/service/node_modules/heapdump/build/config.gypi -I/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/runuser/.node-gyp/6.9.1/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/runuser/.node-gyp/6.9.1" "-Dnode_gyp_dir=/usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/opt/service/node_modules/heapdump" binding.gyp +Makefile: $(srcdir)/../../../../home/runuser/.node-gyp/6.9.1/include/node/common.gypi $(srcdir)/../../../../usr/local/nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included diff --git a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d index f1c3bd7..e043efc 100644 --- a/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d +++ b/node_modules/heapdump/build/Release/.deps/Release/obj.target/addon/src/heapdump.o.d @@ -1,34 +1,36 @@ -cmd_Release/obj.target/addon/src/heapdump.o := g++ '-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/6.9.1/include/node -I/root/.node-gyp/6.9.1/src -I/root/.node-gyp/6.9.1/deps/uv/include -I/root/.node-gyp/6.9.1/deps/v8/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/addon/src/heapdump.o.d.raw -c -o Release/obj.target/addon/src/heapdump.o ../src/heapdump.cc +cmd_Release/obj.target/addon/src/heapdump.o := g++ '-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/runuser/.node-gyp/6.9.1/include/node -I/home/runuser/.node-gyp/6.9.1/src -I/home/runuser/.node-gyp/6.9.1/deps/uv/include -I/home/runuser/.node-gyp/6.9.1/deps/v8/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/addon/src/heapdump.o.d.raw -c -o Release/obj.target/addon/src/heapdump.o ../src/heapdump.cc Release/obj.target/addon/src/heapdump.o: ../src/heapdump.cc \ - /root/.node-gyp/6.9.1/include/node/node.h \ - /root/.node-gyp/6.9.1/include/node/v8.h \ - /root/.node-gyp/6.9.1/include/node/v8-version.h \ - /root/.node-gyp/6.9.1/include/node/v8config.h \ - /root/.node-gyp/6.9.1/include/node/node_version.h ../src/compat-inl.h \ - ../src/compat.h /root/.node-gyp/6.9.1/include/node/node_version.h \ - /root/.node-gyp/6.9.1/include/node/v8.h \ - /root/.node-gyp/6.9.1/include/node/v8-profiler.h \ - /root/.node-gyp/6.9.1/include/node/uv.h \ - /root/.node-gyp/6.9.1/include/node/uv-errno.h \ - /root/.node-gyp/6.9.1/include/node/uv-version.h \ - /root/.node-gyp/6.9.1/include/node/uv-unix.h \ - /root/.node-gyp/6.9.1/include/node/uv-threadpool.h \ - /root/.node-gyp/6.9.1/include/node/uv-linux.h ../src/heapdump-posix.h + /home/runuser/.node-gyp/6.9.1/include/node/node.h \ + /home/runuser/.node-gyp/6.9.1/include/node/v8.h \ + /home/runuser/.node-gyp/6.9.1/include/node/v8-version.h \ + /home/runuser/.node-gyp/6.9.1/include/node/v8config.h \ + /home/runuser/.node-gyp/6.9.1/include/node/node_version.h \ + ../src/compat-inl.h ../src/compat.h \ + /home/runuser/.node-gyp/6.9.1/include/node/node_version.h \ + /home/runuser/.node-gyp/6.9.1/include/node/v8.h \ + /home/runuser/.node-gyp/6.9.1/include/node/v8-profiler.h \ + /home/runuser/.node-gyp/6.9.1/include/node/uv.h \ + /home/runuser/.node-gyp/6.9.1/include/node/uv-errno.h \ + /home/runuser/.node-gyp/6.9.1/include/node/uv-version.h \ + /home/runuser/.node-gyp/6.9.1/include/node/uv-unix.h \ + /home/runuser/.node-gyp/6.9.1/include/node/uv-threadpool.h \ + /home/runuser/.node-gyp/6.9.1/include/node/uv-linux.h \ + ../src/heapdump-posix.h ../src/heapdump.cc: -/root/.node-gyp/6.9.1/include/node/node.h: -/root/.node-gyp/6.9.1/include/node/v8.h: -/root/.node-gyp/6.9.1/include/node/v8-version.h: -/root/.node-gyp/6.9.1/include/node/v8config.h: -/root/.node-gyp/6.9.1/include/node/node_version.h: +/home/runuser/.node-gyp/6.9.1/include/node/node.h: +/home/runuser/.node-gyp/6.9.1/include/node/v8.h: +/home/runuser/.node-gyp/6.9.1/include/node/v8-version.h: +/home/runuser/.node-gyp/6.9.1/include/node/v8config.h: +/home/runuser/.node-gyp/6.9.1/include/node/node_version.h: ../src/compat-inl.h: ../src/compat.h: -/root/.node-gyp/6.9.1/include/node/node_version.h: -/root/.node-gyp/6.9.1/include/node/v8.h: -/root/.node-gyp/6.9.1/include/node/v8-profiler.h: -/root/.node-gyp/6.9.1/include/node/uv.h: -/root/.node-gyp/6.9.1/include/node/uv-errno.h: -/root/.node-gyp/6.9.1/include/node/uv-version.h: -/root/.node-gyp/6.9.1/include/node/uv-unix.h: -/root/.node-gyp/6.9.1/include/node/uv-threadpool.h: -/root/.node-gyp/6.9.1/include/node/uv-linux.h: +/home/runuser/.node-gyp/6.9.1/include/node/node_version.h: +/home/runuser/.node-gyp/6.9.1/include/node/v8.h: +/home/runuser/.node-gyp/6.9.1/include/node/v8-profiler.h: +/home/runuser/.node-gyp/6.9.1/include/node/uv.h: +/home/runuser/.node-gyp/6.9.1/include/node/uv-errno.h: +/home/runuser/.node-gyp/6.9.1/include/node/uv-version.h: +/home/runuser/.node-gyp/6.9.1/include/node/uv-unix.h: +/home/runuser/.node-gyp/6.9.1/include/node/uv-threadpool.h: +/home/runuser/.node-gyp/6.9.1/include/node/uv-linux.h: ../src/heapdump-posix.h: diff --git a/node_modules/heapdump/build/addon.target.mk b/node_modules/heapdump/build/addon.target.mk index a08c6df..3531fef 100644 --- a/node_modules/heapdump/build/addon.target.mk +++ b/node_modules/heapdump/build/addon.target.mk @@ -34,10 +34,10 @@ -std=gnu++0x INCS_Debug := \ - -I/root/.node-gyp/6.9.1/include/node \ - -I/root/.node-gyp/6.9.1/src \ - -I/root/.node-gyp/6.9.1/deps/uv/include \ - -I/root/.node-gyp/6.9.1/deps/v8/include + -I/home/runuser/.node-gyp/6.9.1/include/node \ + -I/home/runuser/.node-gyp/6.9.1/src \ + -I/home/runuser/.node-gyp/6.9.1/deps/uv/include \ + -I/home/runuser/.node-gyp/6.9.1/deps/v8/include DEFS_Release := \ '-DNODE_GYP_MODULE_NAME=addon' \ @@ -69,10 +69,10 @@ -std=gnu++0x INCS_Release := \ - -I/root/.node-gyp/6.9.1/include/node \ - -I/root/.node-gyp/6.9.1/src \ - -I/root/.node-gyp/6.9.1/deps/uv/include \ - -I/root/.node-gyp/6.9.1/deps/v8/include + -I/home/runuser/.node-gyp/6.9.1/include/node \ + -I/home/runuser/.node-gyp/6.9.1/src \ + -I/home/runuser/.node-gyp/6.9.1/deps/uv/include \ + -I/home/runuser/.node-gyp/6.9.1/deps/v8/include OBJS := \ $(obj).target/$(TARGET)/src/heapdump.o diff --git a/node_modules/heapdump/build/config.gypi b/node_modules/heapdump/build/config.gypi index 4f0311d..f36a239 100644 --- a/node_modules/heapdump/build/config.gypi +++ b/node_modules/heapdump/build/config.gypi @@ -57,7 +57,7 @@ "v8_random_seed": 0, "v8_use_snapshot": "true", "want_separate_host_toolset": 0, - "nodedir": "/root/.node-gyp/6.9.1", + "nodedir": "/home/runuser/.node-gyp/6.9.1", "copy_dev_lib": "true", "standalone_static_library": 1, "cache_lock_stale": "60000", @@ -81,7 +81,7 @@ "rollback": "true", "tag_version_prefix": "v", "cache_max": "Infinity", - "userconfig": "/root/.npmrc", + "userconfig": "/home/runuser/.npmrc", "engine_strict": "", "init_author_name": "", "init_author_url": "", @@ -104,7 +104,7 @@ "scope": "", "searchopts": "", "versions": "", - "cache": "/root/.npm", + "cache": "/home/runuser/.npm", "global_style": "", "ignore_scripts": "", "searchsort": "name", @@ -127,7 +127,7 @@ "unicode": "", "long": "", "production": "", - "unsafe_perm": "", + "unsafe_perm": "true", "node_version": "6.9.1", "tag": "latest", "git_tag_version": "true", @@ -139,12 +139,12 @@ "strict_ssl": "true", "dev": "", "globalconfig": "/usr/local/nvm/versions/node/v6.9.1/etc/npmrc", - "init_module": "/root/.npm-init.js", + "init_module": "/home/runuser/.npm-init.js", "parseable": "", "globalignorefile": "/usr/local/nvm/versions/node/v6.9.1/etc/npmignore", "cache_lock_retries": "10", "save_prefix": "^", - "group": "", + "group": "1000", "init_author_email": "", "searchexclude": "", "git": "git", diff --git a/node_modules/kad/package.json b/node_modules/kad/package.json index 499382c..58c8213 100644 --- a/node_modules/kad/package.json +++ b/node_modules/kad/package.json @@ -49,7 +49,7 @@ "/limitation" ], "_resolved": "git+https://github.com/gwicke/kad.git#f35971036f43814043245da82b12d035b7bbfd16", - "_shasum": "4a1ce3df414368710c1cc007eedb4a219924deda", + "_shasum": "f6f5c394c559b5555c6d476773d4c97fa2e27b4d", "_shrinkwrap": null, "_spec": "kad@git+https://github.com/gwicke/kad.git#master", "_where": "/opt/service/node_modules/limitation", diff --git a/node_modules/normalize-package-data/test/normalize.js~ b/node_modules/normalize-package-data/test/normalize.js~ deleted file mode 100644 index de6f1ce..0000000 --- a/node_modules/normalize-package-data/test/normalize.js~ +++ /dev/null @@ -1,253 +0,0 @@ -var tap = require("tap") -var fs = require("fs") -var path = require("path") - -var globals = Object.keys(global) - -var normalize = require("../lib/normalize") -var warningMessages = require("../lib/warning_messages.json") -var safeFormat = require("../lib/safe_format") - -var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json") - -tap.test("normalize some package data", function(t) { - var packageData = require(rpjPath) - var warnings = [] - normalize(packageData, function(warning) { - warnings.push(warning) - }) - // there's no readme data in this particular object - t.equal( warnings.length, 1, "There's exactly one warning.") - fs.readFile(rpjPath, function(err, data) { - if(err) throw err - // Various changes have been made - t.notEqual(packageData, JSON.parse(data), "Output is different from input.") - t.end() - }) -}) - -tap.test("runs without passing warning function", function(t) { - var packageData = require(rpjPath) - fs.readFile(rpjPath, function(err, data) { - if(err) throw err - normalize(JSON.parse(data)) - t.ok(true, "If you read this, this means I'm still alive.") - t.end() - }) -}) - -tap.test("empty object", function(t) { - var packageData = {} - var expect = - { name: '', - version: '', - readme: 'ERROR: No README data found!', - _id: '@' } - - var warnings = [] - function warn(m) { - warnings.push(m) - } - normalize(packageData, warn) - t.same(packageData, expect) - t.same(warnings, [ - warningMessages.missingDescription, - warningMessages.missingRepository, - warningMessages.missingReadme, - warningMessages.missingLicense - ]) - t.end() -}) - -tap.test("core module name", function(t) { - var warnings = [] - function warn(m) { - warnings.push(m) - } - var a - normalize(a={ - name: "http", - readme: "read yourself how about", - homepage: 123, - bugs: "what is this i don't even", - repository: "Hello." - }, warn) - - var expect = [ - safeFormat(warningMessages.conflictingName, 'http'), - warningMessages.nonEmailUrlBugsString, - warningMessages.emptyNormalizedBugs, - warningMessages.nonUrlHomepage, - warningMessages.missingLicense - ] - t.same(warnings, expect) - t.end() -}) - -tap.test("urls required", function(t) { - var warnings = [] - function warn(w) { - warnings.push(w) - } - normalize({ - bugs: { - url: "/1", - email: "not an email address" - } - }, warn) - var a - normalize(a={ - readme: "read yourself how about", - homepage: 123, - bugs: "what is this i don't even", - repository: "Hello." - }, warn) - - console.error(a) - - var expect = - [ warningMessages.missingDescription, - warningMessages.missingRepository, - warningMessages.nonUrlBugsUrlField, - warningMessages.nonEmailBugsEmailField, - warningMessages.emptyNormalizedBugs, - warningMessages.missingReadme, - warningMessages.missingLicense, - warningMessages.nonEmailUrlBugsString, - warningMessages.emptyNormalizedBugs, - warningMessages.nonUrlHomepage, - warningMessages.missingLicense] - t.same(warnings, expect) - t.end() -}) - -tap.test("homepage field must start with a protocol.", function(t) { - var warnings = [] - function warn(w) { - warnings.push(w) - } - var a - normalize(a={ - homepage: 'example.org' - }, warn) - - console.error(a) - - var expect = - [ warningMessages.missingDescription, - warningMessages.missingRepository, - warningMessages.missingReadme, - warningMessages.missingProtocolHomepage, - warningMessages.missingLicense] - t.same(warnings, expect) - t.same(a.homepage, 'http://example.org') - t.end() -}) - -tap.test("license field should be a valid SPDX expression", function(t) { - var warnings = [] - function warn(w) { - warnings.push(w) - } - var a - normalize(a={ - license: 'Apache 2' - }, warn) - - console.error(a) - - var expect = - [ warningMessages.missingDescription, - warningMessages.missingRepository, - warningMessages.missingReadme, - warningMessages.invalidLicense] - t.same(warnings, expect) - t.end() -}) - -tap.test("gist bugs url", function(t) { - var d = { - repository: "g...@gist.github.com:123456.git" - } - normalize(d) - t.same(d.repository, { type: 'git', url: 'git+ssh://g...@gist.github.com/123456.git' }) - t.same(d.bugs, { url: 'https://gist.github.com/123456' }) - t.end(); -}); - -tap.test("singularize repositories", function(t) { - var d = {repositories:["g...@gist.github.com:123456.git"]} - normalize(d) - t.same(d.repository, { type: 'git', url: 'git+ssh://g...@gist.github.com/123456.git' }) - t.end() -}); - -tap.test("treat visionmedia/express as github repo", function(t) { - var d = {repository: {type: "git", url: "visionmedia/express"}} - normalize(d) - t.same(d.repository, { type: "git", url: "git+https://github.com/visionmedia/express.git" }) - t.end() -}); - -tap.test("treat isaacs/node-graceful-fs as github repo", function(t) { - var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}} - normalize(d) - t.same(d.repository, { type: "git", url: "git+https://github.com/isaacs/node-graceful-fs.git" }) - t.end() -}); - -tap.test("homepage field will set to github url if repository is a github repo", function(t) { - var a - normalize(a={ - repository: { type: "git", url: "https://github.com/isaacs/node-graceful-fs" } - }) - t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs#readme') - t.end() -}) - -tap.test("homepage field will set to github gist url if repository is a gist", function(t) { - var a - normalize(a={ - repository: { type: "git", url: "g...@gist.github.com:123456.git" } - }) - t.same(a.homepage, 'https://gist.github.com/123456') - t.end() -}) - -tap.test("homepage field will set to github gist url if repository is a shorthand reference", function(t) { - var a - normalize(a={ - repository: { type: "git", url: "sindresorhus/chalk" } - }) - t.same(a.homepage, 'https://github.com/sindresorhus/chalk#readme') - t.end() -}) - -tap.test("don't mangle github shortcuts in dependencies", function(t) { - var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}} - normalize(d) - t.same(d.dependencies, {"node-graceful-fs": "github:isaacs/node-graceful-fs" }) - t.end() -}); - -tap.test("deprecation warning for array in dependencies fields", function(t) { - var a - var warnings = [] - function warn(w) { - warnings.push(w) - } - normalize(a={ - dependencies: [], - devDependencies: [], - optionalDependencies: [] - }, warn) - t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'dependencies')), "deprecation warning") - t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'devDependencies')), "deprecation warning") - t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'optionalDependencies')), "deprecation warning") - t.end() -}) - -tap.test('no new globals', function(t) { - t.same(Object.keys(global), globals) - t.end() -}) diff --git a/node_modules/preq/.travis.yml b/node_modules/preq/.travis.yml index 47f2d25..eed34de 100644 --- a/node_modules/preq/.travis.yml +++ b/node_modules/preq/.travis.yml @@ -1,7 +1,10 @@ language: node_js node_js: - "0.10" - - "0.11" - - "0.12" - - "iojs" + - "4" + # Test 5.6 / 5.7 as well, as the agent behavior changed between those + # versions. + - "5.6" + - "5.7" + - "6" diff --git a/node_modules/preq/index.js b/node_modules/preq/index.js index 501733a..87f2598 100644 --- a/node_modules/preq/index.js +++ b/node_modules/preq/index.js @@ -4,8 +4,9 @@ var url = require('url'); var util = require('util'); var querystring = require('querystring'); +var semver = require('semver'); -function setupConnectionTimeout(protocol) { +function createConnectTimeoutAgent(protocol) { var http = require(protocol); var Agent = http.Agent; @@ -15,38 +16,55 @@ } util.inherits(ConnectTimeoutAgent, Agent); - ConnectTimeoutAgent.prototype.createSocket = function() { - var s = Agent.prototype.createSocket.apply(this, arguments); - // Set up a connect timeout if connectTimeout option is set - if (this.options.connectTimeout && !s.connectTimeoutTimer) { - s.connectTimeoutTimer = setTimeout(function() { + if (semver.gte(process.version, '5.7.0')) { + ConnectTimeoutAgent.prototype.createSocket = function(req, options, cb) { + var connectTimeoutTimer = setTimeout(function() { var e = new Error('ETIMEDOUT'); e.code = 'ETIMEDOUT'; - s.end(); - s.emit('error', e); - s.destroy(); + cb(e); }, this.options.connectTimeout); - s.once('connect', function() { - if (this.connectTimeoutTimer) { - clearTimeout(this.connectTimeoutTimer); - this.connectTimeoutTimer = undefined; - } - }); - } - return s; - }; - - http.globalAgent = new ConnectTimeoutAgent({ - connectTimeout: 5 * 1000, - // Setting this too high (especially 'Infinity') leads to high - // (hundreds of mb) memory usage in the agent under sustained request - // workloads. 250 should be a reasonable upper bound for practical - // applications. - maxSockets: 250 - }); + Agent.prototype.createSocket.apply(this, [req, options, function(error, newSocket) { + newSocket.on('connect', function() { + clearTimeout(connectTimeoutTimer); + }); + cb(error, newSocket); + }]); + }; + } else { + ConnectTimeoutAgent.prototype.createSocket = function() { + var s = Agent.prototype.createSocket.apply(this, arguments); + // Set up a connect timeout if connectTimeout option is set + if (this.options.connectTimeout && !s.connectTimeoutTimer) { + s.connectTimeoutTimer = setTimeout(function () { + var e = new Error('ETIMEDOUT'); + e.code = 'ETIMEDOUT'; + s.end(); + s.emit('error', e); + s.destroy(); + }, this.options.connectTimeout); + s.once('connect', function () { + if (this.connectTimeoutTimer) { + clearTimeout(this.connectTimeoutTimer); + this.connectTimeoutTimer = undefined; + } + }); + } + return s; + }; + } + return ConnectTimeoutAgent; } -setupConnectionTimeout('http'); -setupConnectionTimeout('https'); + +var agentOptions = { + connectTimeout: (process.env.PREQ_CONNECT_TIMEOUT || 5) * 1000, + // Setting this too high (especially 'Infinity') leads to high + // (hundreds of mb) memory usage in the agent under sustained request + // workloads. 250 should be a reasonable upper bound for practical + // applications. + maxSockets: 250 +}; +var httpAgentClass = createConnectTimeoutAgent('http'); +var httpsAgentClass = createConnectTimeoutAgent('https'); var request = P.promisify(require('request'), { multiArgs: true }); @@ -64,6 +82,7 @@ } else { o.uri = uri; } + o.uri = o.uri || o.url; o.method = method; if (o.body && o.body instanceof Object) { if (o.headers && /^application\/json/.test(o.headers['content-type'])) { @@ -106,6 +125,9 @@ o._encodingProvided = true; } + o.agentClass = /^https/.test(o.uri) ? httpsAgentClass : httpAgentClass; + o.agentOptions = agentOptions; + return o; } diff --git a/node_modules/preq/package.json b/node_modules/preq/package.json index ef891ab..77b194c 100644 --- a/node_modules/preq/package.json +++ b/node_modules/preq/package.json @@ -2,48 +2,48 @@ "_args": [ [ { - "raw": "preq@^0.4.10", + "raw": "preq@^0.5.2", "scope": null, "escapedName": "preq", "name": "preq", - "rawSpec": "^0.4.10", - "spec": ">=0.4.10 <0.5.0", + "rawSpec": "^0.5.2", + "spec": ">=0.5.2 <0.6.0", "type": "range" }, "/opt/service" ] ], - "_from": "preq@>=0.4.10 <0.5.0", - "_id": "preq@0.4.12", + "_from": "preq@>=0.5.2 <0.6.0", + "_id": "preq@0.5.2", "_inCache": true, "_location": "/preq", "_nodeVersion": "4.6.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/preq-0.4.12.tgz_1476834114417_0.39123208122327924" + "tmp": "tmp/preq-0.5.2.tgz_1481910725214_0.5199266695417464" }, "_npmUser": { - "name": "pchelolo", - "email": "petrpche...@gmail.com" + "name": "doorman", + "email": "marko.obro...@gmail.com" }, "_npmVersion": "2.15.9", "_phantomChildren": {}, "_requested": { - "raw": "preq@^0.4.10", + "raw": "preq@^0.5.2", "scope": null, "escapedName": "preq", "name": "preq", - "rawSpec": "^0.4.10", - "spec": ">=0.4.10 <0.5.0", + "rawSpec": "^0.5.2", + "spec": ">=0.5.2 <0.6.0", "type": "range" }, "_requiredBy": [ "/" ], - "_resolved": "https://registry.npmjs.org/preq/-/preq-0.4.12.tgz", - "_shasum": "4056595182ed395aefa2e7595f6f2038bb6fa0c5", + "_resolved": "https://registry.npmjs.org/preq/-/preq-0.5.2.tgz", + "_shasum": "dcd3d645f6ebb48ccdff1dbb5a35dec86b708617", "_shrinkwrap": null, - "_spec": "preq@^0.4.10", + "_spec": "preq@^0.5.2", "_where": "/opt/service", "author": { "name": "Gabriel Wicke", @@ -54,7 +54,8 @@ }, "dependencies": { "bluebird": "^3.1.1", - "request": "^2.67.0" + "request": "^2.67.0", + "semver": "^5.3.0" }, "description": "Yet another promising request wrapper", "devDependencies": { @@ -62,10 +63,10 @@ }, "directories": {}, "dist": { - "shasum": "4056595182ed395aefa2e7595f6f2038bb6fa0c5", - "tarball": "https://registry.npmjs.org/preq/-/preq-0.4.12.tgz" + "shasum": "dcd3d645f6ebb48ccdff1dbb5a35dec86b708617", + "tarball": "https://registry.npmjs.org/preq/-/preq-0.5.2.tgz" }, - "gitHead": "1c2f6b909dad53cf7123fb224b68deb60f6477f5", + "gitHead": "5bfb54cad6a19580a10cfae9f846904e7b216990", "homepage": "https://github.com/wikimedia/preq", "license": "MIT", "main": "index.js", @@ -93,5 +94,5 @@ "scripts": { "test": "mocha" }, - "version": "0.4.12" + "version": "0.5.2" } diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json index b6f362b..57e79bc 100644 --- a/node_modules/semver/package.json +++ b/node_modules/semver/package.json @@ -10,7 +10,7 @@ "spec": ">=5.3.0 <6.0.0", "type": "range" }, - "/opt/service/node_modules/service-runner" + "/opt/service/node_modules/preq" ] ], "_from": "semver@>=5.3.0 <6.0.0", @@ -39,13 +39,14 @@ }, "_requiredBy": [ "/normalize-package-data", + "/preq", "/service-runner" ], "_resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "_shasum": "9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f", "_shrinkwrap": null, "_spec": "semver@^5.3.0", - "_where": "/opt/service/node_modules/service-runner", + "_where": "/opt/service/node_modules/preq", "bin": { "semver": "./bin/semver" }, diff --git a/node_modules/swagger-ui/package.json b/node_modules/swagger-ui/package.json index e1905f8..baed03c 100644 --- a/node_modules/swagger-ui/package.json +++ b/node_modules/swagger-ui/package.json @@ -49,7 +49,7 @@ "/" ], "_resolved": "git+https://github.com/wikimedia/swagger-ui.git#b9b40dc8e00caeb24c19fe636b93250a7e335541", - "_shasum": "f00f1314996155dac0cf2a8d29703a3d1feab77b", + "_shasum": "80cff12c2cb5bedaf24e4e0c48b9565a1603bfb0", "_shrinkwrap": null, "_spec": "swagger-ui@git+https://github.com/wikimedia/swagger-ui.git#master", "_where": "/opt/service", diff --git a/src b/src index 1fc3a54..f3c8a19 160000 --- a/src +++ b/src @@ -1 +1 @@ -Subproject commit 1fc3a549d7c6231a5de943b7b1a556b79bc36eee +Subproject commit f3c8a19353bcef46f2c348972034f2f833335d48 -- To view, visit https://gerrit.wikimedia.org/r/333142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3041cce63cf26b20ca7ac2a877473bbe55638bf0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/cxserver/deploy Gerrit-Branch: master Gerrit-Owner: Mobrovac <mobro...@wikimedia.org> Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits