{"record":{"id":"9c885e0052fab9e0","repo":"apache/seatunnel","slug":"get-overview-dispatch-delayed-dispatchdelayms","errorCode":null,"errorMessage":"GET /overview dispatch delayed: dispatchDelayMs={} thread={}","messagePattern":"GET /overview 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/OverviewServlet.java","lineNumber":79,"sourceCode":"        }\n\n        long startNs = System.nanoTime();\n        Map<String, String> tags = getParameterMap(req);\n\n        JsonObject body =\n                JsonUtil.toJsonObject(\n                        JsonUtils.toMap(\n                                JsonUtils.toJsonString(overviewService.getOverviewInfo(tags))));\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        writeJson(resp, body);\n        if (dispatchDelayMs > 500) {\n            log.warn(\n                    \"GET /overview dispatch delayed: dispatchDelayMs={} thread={}\",\n                    dispatchDelayMs,\n                    Thread.currentThread().getName());\n        }\n        if (costMs > 500) {\n            Runtime rt = Runtime.getRuntime();\n            long usedBytes = rt.totalMemory() - rt.freeMemory();\n            log.warn(\n                    \"GET /overview slow: costMs={} thread={} heapUsedMB={} heapTotalMB={} \"\n                            + \"heapMaxMB={}\",\n                    costMs,\n                    Thread.currentThread().getName(),\n                    usedBytes / 1024 / 1024,\n                    rt.totalMemory() / 1024 / 1024,\n                    rt.maxMemory() / 1024 / 1024);\n        }\n    }\n}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/OverviewServlet.java#L61-L97","documentation":"A self-monitoring warning in OverviewServlet.doGet: the request spent more than 500ms waiting before dispatch (e.g. queued in the servlet thread pool or blocked upstream). It exposes the delay via the X-Dispatch-Delay-Ms header and logs the serving thread name.","triggerScenarios":"GET /overview when the Jetty/REST thread pool is saturated or the handler thread is starved; system under heavy load, GC pauses, or many concurrent REST calls delaying dispatch.","commonSituations":"Large clusters where the overview handler competes with heavy engine work; monitoring systems polling /overview at high frequency; worker overload causing slow request acceptance.","solutions":["Reduce polling frequency of the /overview endpoint in your monitoring setup","Increase the REST service thread pool size in the cluster configuration","Check GC logs and heap pressure on the node — the companion heap diagnostics (costMs > 500) show memory stats","Profile what else is running on the node; offload heavy work from the master node serving the REST API"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// track the dispatch-delay header before continuing polling\nconst delayMs = Number(resp.headers.get('X-Dispatch-Delay-Ms') || 0);\nif (delayMs > 500) backoff();","typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(baseUrl + '/overview');\n  if (Number(resp.headers.get('X-Dispatch-Delay-Ms')) > 500) {\n    await sleep(pollInterval * 2); // back off before next poll\n  }\n} catch (e) { /* retry with backoff */ }","preventionTips":["Poll /overview at moderate intervals (>= 5s)","Increase REST thread pool if many clients poll concurrently","Monitor node GC and CPU load","Alert on X-Dispatch-Delay-Ms header values rather than raw failures"],"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"}