6-2 - Client Timeout
6-2 - Client Timeout
Timeout occurs when the caller is unable to receive a corresponding response within a specified time after sending the request.
Possible Causes
- The server is indeed processing slowly and cannot return results within the specified time, causing the caller to automatically return a timeout exception response to terminate the call.
- If the server responds quickly, but when the client is under heavy load, issues like requests being unable to be sent or responses getting stuck in the TCP Buffer can cause timeouts. This is because data sent from the server or requests from the client get queued at the system level, and if system load is high, the kernel time will increase, resulting in a timeout by the time the client receives the value.
- Usually, this is due to slow business processing. You can execute
jstack [PID] > jstack.log
on the service provider’s machine to analyze where the threads are stuck, identifying the cause of slowness. If performance cannot be optimized, consider increasing the timeout threshold.
Troubleshooting and Resolution Steps
- Both sides may have GC occurring. Check the GC logs on both the server and client. Prolonged GC can lead to timeouts. The occurrence of a timeout likely indicates resource bottlenecks (CPU, memory, or network) on either the caller or server; thus, it’s necessary to check for GC jitter, among other issues.
- Check the network quality of the server, such as retransmission rates to rule out network issues.
- Utilize link tracing analysis services (like Alibaba’s ARMS, open-source implementations of OpenTracing, Zipkin, SkyWalking, etc.) to analyze the timing of each point.
This error code’s FAQ page references Kong Ming’s article “Common Errors and Solutions in Dubbo”.
The cited article permits compilation under the CC-BY-4.0 license. Special thanks to the original author.