Parcourir la source

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

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

GitOrigin-RevId: 86aa1e01b8cb465b8b9332e17fb97c21849d0489
Andrew Rumble il y a 5 mois
Parent
commit
5723a9589a

+ 1 - 1
services/clsi/app.js

@@ -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)

+ 2 - 0
services/web/app/src/Features/Compile/ClsiManager.mjs

@@ -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,

+ 1 - 1
services/web/app/src/Features/Compile/CompileController.mjs

@@ -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-]/)