Skip to content

Dispatcher.readyAsyncCalls is unbounded, which may cause OOM #8032

@sifei-wang

Description

@sifei-wang

It seems that there's no way to control the max size of Dispatcher.readyAsyncCalls.

Consider the following scenario:

  1. HTTP server hangs (or unable to respond quickly);
  2. Use okhttp to send a large amount of HTTP async requests to the above server;
  3. Outgoing requests are stored in Dispatcher.runningAsyncCalls and wait for response/timeout, which means the throughput is very low;
  4. Other requests are kept in Dispatcher.readyAsyncCalls, without timeout or limitation of max count. If we keep sending requests, the memory usage of Dispatcher.readyAsyncCalls keeps growing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug in existing code

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions