All Products
Search
Document Center

Tablestore:What do I do if the "Wait future timeout" error message appears when I use an SDK to send an API request?

Last Updated:Nov 22, 2024

If the "Wait future timeout" error occurs, make sure that a full garbage collection (GC) does not occur on the client and the client.shutdown() method is not called during the request, and check whether the latency on the server is too high.

Problem description

When I use an SDK to send an API request, the "Wait future timeout" error message appears on the server.

Cause

The duration from the time when the request is sent to the time when the response is returned exceeds the value of the syncClientWaitFutureTimeoutInMillis parameter. The default value of the syncClientWaitFutureTimeoutInMillis parameter is 60000, in milliseconds.

Note

We recommend that you do not set the syncClientWaitFutureTimeoutInMillis parameter to an excessively small value. You can specify a value for the syncClientWaitFutureTimeoutInMillis parameter in ClientConfiguration.

The error may occur due to the following reasons:

  • A full GC is triggered on the client, or you call the client.shutdown() method on the client during the request.

  • The latency on the server is greater than the value of the syncClientWaitFutureTimeoutInMillis parameter.

Solution

  • Check whether a full GC is triggered on the client.

    Use tools such as jmap or jcmd to troubleshoot the Java virtual machine (JVM). For example, check the memory usage of the JVM, and check whether out of memory (OOM) occurs.

    • Optimize the code if the memory is improperly used or memory leak occurs.

    • Increase the memory if the memory is properly used but the JVM resources are insufficient.

    • If the JVM is idle and a small amount of memory is used, increase the heap memory of the JVM to reduce the probability of errors.

    In addition, if the JVM is heavily loaded with a high network anomaly rate and high CPU usage, the "Wait future timeout" error also occurs. In most cases, the request may have timed out before it is sent.

  • Check whether the callback thread is closed because the client calls the client.shutdown() method during the request.

  • Perform the following steps to check whether the latency on the server is high:

    1. Log on to the Tablestore console .

    2. In the top navigation bar, select a resource group and a region.

    3. In the instance list of the Overview page, click the name of the instance.

    4. In the Tables section of the Instance Details tab, click the name of the data table.

    5. On the Monitoring Indicators tab of the Manage Table page, select the table or index, specify a time range, and set Metric Group to Average Latency to view the average latency of different operation types.

      If the latency on the server is greater than the value of the syncClientWaitFutureTimeoutInMillis parameter, submit a ticket to contact Tablestore technical support.

      fig_20220217_mointor