{"record":{"id":"636222ba040b94dd","repo":"apache/seatunnel","slug":"get-running-jobs-dispatch-delayed-dispatchdelaym","errorCode":null,"errorMessage":"GET /running-jobs dispatch delayed: dispatchDelayMs={} thread={}","messagePattern":"GET /running-jobs dispatch delayed: dispatchDelayMs=(.+?) thread=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/RunningJobsServlet.java","lineNumber":81,"sourceCode":"                req.getRequestURI() != null\n                        && req.getRequestURI().endsWith(RestConstant.REST_URL_RUNNING_JOBS_SUMMARY);\n        boolean full = !summary || Boolean.parseBoolean(req.getParameter(\"full\"));\n\n        JsonArray runningJobs =\n                full\n                        ? jobInfoService.getRunningJobsJson()\n                        : jobInfoService.getRunningJobsSummaryJson();\n\n        long costMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs);\n        long dispatchDelayMs = receivedMs <= 0 ? -1 : Math.max(0, nowMs - receivedMs);\n\n        resp.setHeader(\"X-Dispatch-Delay-Ms\", String.valueOf(dispatchDelayMs));\n        resp.setHeader(\"X-Handler-Cost-Ms\", String.valueOf(costMs));\n\n        writeJsonWithPagination(req, resp, runningJobs);\n\n        if (dispatchDelayMs > 500) {\n            log.warn(\n                    \"GET /running-jobs dispatch delayed: dispatchDelayMs={} thread={}\",\n                    dispatchDelayMs,\n                    Thread.currentThread().getName());\n        }\n        if (costMs > 500) {\n            log.warn(\"GET /running-jobs slow: full={} costMs={}\", full, costMs);\n            Runtime rt = Runtime.getRuntime();\n            long usedBytes = rt.totalMemory() - rt.freeMemory();\n            log.warn(\n                    \"GET /running-jobs slow diagnostics: full={} costMs={} thread={} \"\n                            + \"heapUsedMB={} heapTotalMB={} heapMaxMB={}\",\n                    full,\n                    costMs,\n                    Thread.currentThread().getName(),\n                    usedBytes / 1024 / 1024,\n                    rt.totalMemory() / 1024 / 1024,\n                    rt.maxMemory() / 1024 / 1024);\n        } else {","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/RunningJobsServlet.java#L63-L99","documentation":"RunningJobsServlet.doGet logs this when GET /running-jobs waited over 500ms before dispatch, similar to the overview delay warning. The actual delay is also returned in the X-Dispatch-Delay-Ms response header.","triggerScenarios":"GET /running-jobs when the REST thread pool is busy or the request is queued behind other work; heavy cluster load delaying servlet dispatch.","commonSituations":"High-frequency polling of /running-jobs by dashboards; REST thread pool exhaustion during cluster stress; coordinator node overloaded by scheduling work.","solutions":["Throttle/poll /running-jobs less frequently","Increase REST server thread pool size","Check coordinator node load (CPU, GC) and consider separating REST-serving and scheduling load","Use pagination parameters (supported by this endpoint) to keep responses small"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const delay = Number(resp.headers.get('X-Dispatch-Delay-Ms') || 0);\nif (delay > 500) await sleep(pollInterval);","typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(baseUrl + '/running-jobs?page=1&pageSize=20');\n  if (Number(resp.headers.get('X-Dispatch-Delay-Ms')) > 500) {\n    await sleep(backoff);\n  }\n} catch (e) { /* retry with backoff */ }","preventionTips":["Use paginated requests to keep handler work small","Limit poll frequency across dashboards/scripts","Raise REST thread pool size under concurrent polling","Watch coordinator node load metrics"],"tags":["performance","rest-api","latency"],"backgroundTag":"request-timeout","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}