Merge remote-tracking branch 'origin/master' into jpa-entry-point-cleanup

This commit is contained in:
Jakob Ackermann 2020-04-03 14:05:36 +02:00
commit 6a615d50d3
6 changed files with 10 additions and 12 deletions

View file

@ -99,11 +99,7 @@ module.exports = DockerRunner = {
error,
output
) {
if (
__guard__(error != null ? error.message : undefined, x =>
x.match('HTTP code is 500')
)
) {
if (error && error.statusCode === 500) {
logger.log(
{ err: error, project_id },
'error running container so destroying and retrying'

View file

@ -324,6 +324,7 @@ module.exports = ResourceWriter = {
},
'error downloading file for resources'
)
Metrics.inc('download-failed')
}
return callback()
}

View file

@ -3816,9 +3816,9 @@
}
},
"logger-sharelatex": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/logger-sharelatex/-/logger-sharelatex-1.9.0.tgz",
"integrity": "sha512-yVTuha82047IiMOQLgQHCZGKkJo6I2+2KtiFKpgkIooR2yZaoTEvAeoMwBesSDSpGUpvUJ/+9UI+PmRyc+PQKQ==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/logger-sharelatex/-/logger-sharelatex-1.9.1.tgz",
"integrity": "sha512-9s6JQnH/PN+Js2CmI8+J3MQCTNlRzP2Dh4pcekXrV6Jm5J4HzyPi+6d3zfBskZ4NBmaUVw9hC4p5dmdaRmh4mQ==",
"requires": {
"@google-cloud/logging-bunyan": "^2.0.0",
"@overleaf/o-error": "^2.0.0",

View file

@ -26,7 +26,7 @@
"fs-extra": "^8.1.0",
"heapdump": "^0.3.15",
"lockfile": "^1.0.4",
"logger-sharelatex": "^1.9.0",
"logger-sharelatex": "^1.9.1",
"lynx": "0.2.0",
"metrics-sharelatex": "^2.6.0",
"mysql": "^2.18.1",

View file

@ -202,9 +202,9 @@ describe('DockerRunner', function() {
}
if (firstTime) {
firstTime = false
return callback(
new Error('HTTP code is 500 which indicates error: server error')
)
const error = new Error('(HTTP code 500) server error - ...')
error.statusCode = 500
return callback(error)
} else {
return callback(null, this.output)
}

View file

@ -36,6 +36,7 @@ describe('ResourceWriter', function() {
'./OutputFileFinder': (this.OutputFileFinder = {}),
'logger-sharelatex': { log: sinon.stub(), err: sinon.stub() },
'./Metrics': (this.Metrics = {
inc: sinon.stub(),
Timer: (Timer = (function() {
Timer = class Timer {
static initClass() {