Merge pull request #31567 from overleaf/ar-fb/handle-clsi-timeout-better

[clsi-lb,v1,clsi,web] handle clsi timeout better

GitOrigin-RevId: 86aa1e01b8cb465b8b9332e17fb97c21849d0489
This commit is contained in:
Andrew Rumble
2026-03-03 09:38:35 +00:00
committed by Copybot
parent 48407c7d36
commit 5723a9589a
3 changed files with 4 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ app.use(Metrics.http.monitor(logger))
// Compile requests can take longer than the default two
// minutes (including file download time), so bump up the
// timeout a bit.
const TIMEOUT = 10 * 60 * 1000
const TIMEOUT = 630 * 1000 // 10.5 minutes - 30 seconds download allowance
app.use(function (req, res, next) {
req.setTimeout(TIMEOUT)
res.setTimeout(TIMEOUT)

View File

@@ -609,6 +609,8 @@ async function _postToClsi(
return { response: { compile: { status: 'compile-in-progress' } } }
} else if (err.response.status === 503) {
return { response: { compile: { status: 'unavailable' } } }
} else if (err.response.status === 504) {
return { response: { compile: { status: 'timedout' } } }
} else {
throw new OError('CLSI returned non-success code', {
projectId,

View File

@@ -30,7 +30,7 @@ const ClsiCookieManager = ClsiCookieManagerFactory(
Settings.apis.clsi?.backendGroupName
)
const COMPILE_TIMEOUT_MS = 10 * 60 * 1000
const COMPILE_TIMEOUT_MS = 12 * 60 * 1000
const buildIdSchema = z.string().regex(/[a-z0-9-]/)