{"record":{"id":"6262550f508d62c1","repo":"alibaba/nacos","slug":"request-timeout-after-timeout-milliseconds-requ","errorCode":null,"errorMessage":"request timeout after {timeout} milliseconds, requestId={requestId}, connectionId={connectionId}","messagePattern":"request timeout after (.+?) milliseconds, requestId=(.+?), connectionId=(.+?)","errorType":"exception","errorClass":"TimeoutException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/com/alibaba/nacos/api/remote/DefaultRequestFuture.java","lineNumber":169,"sourceCode":"            }\n        } else if (timeout > 0) {\n            long end = System.currentTimeMillis() + timeout;\n            long waitTime = timeout;\n            synchronized (this) {\n                while (!isDone && waitTime > 0) {\n                    wait(waitTime);\n                    waitTime = end - System.currentTimeMillis();\n                }\n            }\n        }\n        \n        if (isDone) {\n            return response;\n        } else {\n            if (timeoutFuture == null && futureTrigger != null) {\n                futureTrigger.triggerOnTimeout();\n            }\n            throw new TimeoutException(\n                \"request timeout after \" + timeout + \" milliseconds, requestId=\" + requestId\n                    + \", connectionId=\"\n                    + connectionId);\n        }\n    }\n    \n    class CallBackHandler implements Runnable {\n        \n        @Override\n        public void run() {\n            if (exception != null) {\n                requestCallBack.onException(exception);\n            } else {\n                requestCallBack.onResponse(response);\n            }\n        }\n    }\n    ","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/api/src/main/java/com/alibaba/nacos/api/remote/DefaultRequestFuture.java#L151-L187","documentation":"DefaultRequestFuture.get throws a TimeoutException when the server has not produced a response within the configured timeout. The message includes timeout (ms), requestId, and connectionId to aid diagnosis. It indicates the request was sent but no reply arrived in time.","triggerScenarios":"Any gRPC request to the Nacos server (config get/publish, instance register, subscribe) that does not receive a response within the client timeout window.","commonSituations":"Server GC pause or overload; network partition; gRPC connection silently dropped; request queue saturated on server; timeout set too low for a large payload (e.g. big config publish).","solutions":["Check server health, GC logs, and network latency between client and server.","Increase the client request timeout property for large-payload or slow operations.","Verify the gRPC connection is still alive; let the SDK reconnect.","Retry with exponential backoff; idempotent reads are safe to retry.","Reduce payload size or shard batch operations."],"exampleFix":"// before\nProperties p = new Properties();\np.setProperty(\"serverAddr\", \"nacos:8848\");\nNamingService ns = NacosFactory.createNamingService(p);  // default timeout\n\n// after\nProperties p = new Properties();\np.setProperty(\"serverAddr\", \"nacos:8848\");\np.setProperty(\"com.alibaba.nacos.naming.request.timeout.ms\", \"10000\");\nNamingService ns = NacosFactory.createNamingService(p);","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"int attempt = 0;\nwhile (true) {\n    try {\n        return future.get(timeoutMs);\n    } catch (TimeoutException e) {\n        if (++attempt > MAX_RETRIES) throw e;\n        sleep(backoffMillis(attempt));  // exponential backoff\n    }\n}","preventionTips":["Size the client timeout to expected server latency plus headroom.","Monitor gRPC connection health and reconnect proactively.","Make read operations idempotent so retries are safe.","Watch server GC and load metrics; timeouts often originate server-side."],"tags":["rpc","timeout","network","grpc","client"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}