jenkins-bot has submitted this change and it was merged. Change subject: Temporarily disable the request timeout ......................................................................
Temporarily disable the request timeout * Until we can actually halt the wt2html pipeline. Mostly this just results in disabling the cpu timeout when we really need it. https://phabricator.wikimedia.org/T110961#1871639 Change-Id: I627dc64de68a1c296639ced4e32ccfdf61e052d4 --- M lib/api/apiUtils.js M lib/api/routes.js 2 files changed, 19 insertions(+), 19 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/api/apiUtils.js b/lib/api/apiUtils.js index 88607fd..75a4eda 100644 --- a/lib/api/apiUtils.js +++ b/lib/api/apiUtils.js @@ -292,7 +292,7 @@ apiUtils.endHtml2wt = function(ret) { var env = ret.env; var timer = env.conf.parsoid.performanceTimer; - var REQ_TIMEOUT = env.conf.parsoid.timeouts.request; + // var REQ_TIMEOUT = env.conf.parsoid.timeouts.request; // As per https://www.mediawiki.org/wiki/Parsoid/API#v1_API_entry_points // "Both it and the oldid parameter are needed for @@ -301,7 +301,7 @@ var hasOldId = (env.page.id && env.page.id !== '0'); var useSelser = hasOldId && env.conf.parsoid.useSelser; return DU.serializeDOM(env, ret.doc.body, useSelser) - .timeout(REQ_TIMEOUT) + // .timeout(REQ_TIMEOUT) .then(function(output) { if (timer) { timer.timing('html2wt.total', '', diff --git a/lib/api/routes.js b/lib/api/routes.js index 21d2e67..c50d505 100644 --- a/lib/api/routes.js +++ b/lib/api/routes.js @@ -19,8 +19,7 @@ module.exports = function(parsoidConfig, processLogger) { var routes = {}; - - var REQ_TIMEOUT = parsoidConfig.timeouts.request; + // var REQ_TIMEOUT = parsoidConfig.timeouts.request; // This helper is only to be used in middleware, before an environment // is setup. The logger doesn't emit the expected location info. @@ -257,11 +256,10 @@ var p = TemplateRequest.setPageSrcInfo(env, target, oldid).then(function() { env.log('info', 'started parsing'); return env.pipelineFactory.parse(env, env.page.src); - }).then( - apiUtils.roundTripDiff.bind(null, env, req, res, false) - ).timeout(REQ_TIMEOUT).then( - apiUtils.rtResponse.bind(null, env, req, res) - ); + }) + .then(apiUtils.roundTripDiff.bind(null, env, req, res, false)) + // .timeout(REQ_TIMEOUT) + .then(apiUtils.rtResponse.bind(null, env, req, res)); return apiUtils.cpuTimeout(p, res) .catch(apiUtils.timeoutResp.bind(null, env)); @@ -292,9 +290,9 @@ // strip newlines from the html var html = doc.innerHTML.replace(/[\r\n]/g, ''); return apiUtils.roundTripDiff(env, req, res, false, DU.parseHTML(html)); - }).timeout(REQ_TIMEOUT).then( - apiUtils.rtResponse.bind(null, env, req, res) - ); + }) + // .timeout(REQ_TIMEOUT) + .then(apiUtils.rtResponse.bind(null, env, req, res)); return apiUtils.cpuTimeout(p, res) .catch(apiUtils.timeoutResp.bind(null, env)); @@ -325,9 +323,9 @@ var comment = doc.createComment('rtSelserEditTestComment'); doc.body.appendChild(comment); return apiUtils.roundTripDiff(env, req, res, true, doc); - }).timeout(REQ_TIMEOUT).then( - apiUtils.rtResponse.bind(null, env, req, res) - ); + }) + // .timeout(REQ_TIMEOUT) + .then(apiUtils.rtResponse.bind(null, env, req, res)); return apiUtils.cpuTimeout(p, res) .catch(apiUtils.timeoutResp.bind(null, env)); @@ -372,7 +370,7 @@ var p = apiUtils.startWt2html(req, res, wt).then(function(ret) { if (typeof ret.wikitext === 'string') { return apiUtils.parseWt(ret) - .timeout(REQ_TIMEOUT) + // .timeout(REQ_TIMEOUT) .then(apiUtils.endWt2html.bind(null, ret)); } else if (ret.oldid) { var p2 = Promise.resolve(ret); @@ -410,7 +408,9 @@ } else { apiUtils.setHeader(res, env, 'Cache-Control', 's-maxage=2592000'); } - }).timeout(REQ_TIMEOUT).then(apiUtils.endWt2html.bind(null, ret)); + }) + // .timeout(REQ_TIMEOUT) + .then(apiUtils.endWt2html.bind(null, ret)); } else { var revid = env.page.meta.revision.revid; var path = [ @@ -463,7 +463,7 @@ var p = apiUtils.startWt2html(req, res, wt).then(function(ret) { if (typeof ret.wikitext === 'string') { return apiUtils.parseWt(ret) - .timeout(REQ_TIMEOUT) + // .timeout(REQ_TIMEOUT) .then(apiUtils.v2endWt2html.bind(null, ret)); } else if (ret.oldid) { var p2 = Promise.resolve(ret); @@ -496,7 +496,7 @@ // cache in the meantime. apiUtils.setHeader(res, env, 'Cache-Control', 'private,no-cache,s-maxage=0'); }) - .timeout(REQ_TIMEOUT) + // .timeout(REQ_TIMEOUT) .then(apiUtils.v2endWt2html.bind(null, ret)); } else { var revid = env.page.meta.revision.revid; -- To view, visit https://gerrit.wikimedia.org/r/259330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I627dc64de68a1c296639ced4e32ccfdf61e052d4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra <[email protected]> Gerrit-Reviewer: Arlolra <[email protected]> Gerrit-Reviewer: Cscott <[email protected]> Gerrit-Reviewer: GWicke <[email protected]> Gerrit-Reviewer: Subramanya Sastry <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
