Error message
HSFTimeOutExceptionThe consumer throws HSFTimeOutException when a service call does not receive a response within the configured timeout period. The default timeout is 3 seconds.
Causes
This error typically occurs in one of the following scenarios:
| Cause | Where to look |
|---|---|
| Network connectivity failure between consumer and provider | Consumer and provider hosts |
| Provider processing time exceeds the timeout period | hsf.log on the provider |
| Serialization error on the provider side | hsf.log on the provider |
| Long garbage collection (GC) pauses on the consumer or provider | GC logs on both sides |
| Consumer overload prevents outbound requests | Consumer host metrics |
Troubleshooting
Work through the following checks in order. Start with network connectivity, then move to server-side diagnostics.
Step 1: Verify network connectivity
Check whether the consumer can reach the provider over the network.
Log in to the Elastic Compute Service (ECS) instance where the consumer runs.
Ping the provider IP address to verify connectivity.
If the ping fails, investigate the network path between the consumer and provider instances.
Note: If the provider IP address is unreachable, the remaining steps will not resolve the timeout. Fix the network issue first.
Step 2: Check provider processing time
If the network is healthy, the provider may take too long to respond.
Check the service execution timeout logs in hsf.log on the provider to identify the slow class and method.
If the processing time exceeds 3 seconds, investigate the following sub-causes:
Serialization error
A serialization error on the provider side can cause the response to hang. Common triggers include:
Stream-type data passed as a parameter or return value
File objects included in the service interface
Oversized objects that exceed serialization limits
Fix: Remove non-serializable data types from the service interface. Do not pass stream-type data, file objects, or oversized objects through HSF service calls.
Slow code execution
The provider method itself may be too slow.
Fix: Profile the provider method to identify performance bottlenecks and optimize the code.
Complex business logic
If the provider legitimately needs more than 3 seconds to process the request, the default timeout is too short.
Fix: Increase the timeout value in the HSF service configuration. For details, see Developer Guide.
Step 3: Check for GC pauses
Long GC pauses on either the consumer or provider can cause intermittent timeouts, especially when timeouts occur sporadically rather than consistently.
Check the GC logs on both the consumer and provider.
Look for Full GC events with long pause durations. GC that requires a long time may result in timeout.
Fix: Tune JVM garbage collection parameters. For more information about troubleshooting methods, search for Java GC optimization on the Internet.
Step 4: Check consumer load
If the consumer itself is overloaded, it may fail to send requests before the timeout expires.
Fix: Scale out the consumer by adding more instances to distribute the load.
Quick reference
| Symptom | Most likely cause | First action |
|---|---|---|
| All calls to a specific provider fail | Network connectivity | Ping the provider IP |
| Calls fail after working previously | Provider processing time or GC | Check hsf.log and GC logs on the provider |
| Intermittent timeouts across multiple providers | Consumer overload or GC on consumer | Check consumer CPU, memory, and GC logs |
| Timeout only for specific methods | Slow code or serialization error | Profile the slow method; check for non-serializable types |