# Caused by: java.util.concurrent.CancellationException: Request execution cancelled

**URL:** <https://discuss.elastic.co/t/caused-by-java-util-concurrent-cancellationexception-request-execution-cancelled/318864>\
**Category:** Elasticsearch\
**Tags:** docker, language-clients\
**Created:** [November 14, 2022, 11:15am UTC](https://discuss.elastic.co/t/caused-by-java-util-concurrent-cancellationexception-request-execution-cancelled/318864 "2022-11-14T11:15:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tungli](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@tungli](https://discuss.elastic.co/u/tungli)\
**Post date:** [November 14, 2022, 11:15am UTC](https://discuss.elastic.co/t/caused-by-java-util-concurrent-cancellationexception-request-execution-cancelled/318864/1 "2022-11-14T11:15:05Z")

</div>

I use es7.15.2 , elasticsearch-java-8.4.2, ElasticsearchAsyncClient, After a period of time，it can't link to es and throw Caused by: java.util.concurrent.CancellationException: Request execution cancelled

```auto
Caused by: java.util.concurrent.CancellationException: Request execution cancelled 
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.execute(CloseableHttpAsyncClientBase.java:114) ~[httpasyncclient-4.1.5.jar:4.1.5] 
at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:138) ~[httpasyncclient-4.1.5.jar:4.1.5] 
at org.elasticsearch.client.RestClient.lambda$performRequestAsync$0(RestClient.java:392) ~[elasticsearch-rest-client-7.17.4.jar:7.17.4] 
at org.elasticsearch.client.Cancellable$RequestCancellable.runIfNotCancelled(Cancellable.java:90) ~[elasticsearch-rest-client-7.17.4.jar:7.17.4] 
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:390) ~[elasticsearch-rest-client-7.17.4.jar:7.17.4] 
at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:377) ~[elasticsearch-rest-client-7.17.4.jar:7.17.4] 
at co.elastic.clients.transport.rest_client.RestClientTransport.performRequestAsync(RestClientTransport.java:162) ~[elasticsearch-java-8.4.2.jar:na] 
at co.elastic.clients.elasticsearch.ElasticsearchAsyncClient.search(ElasticsearchAsyncClient.java:1476) ~[elasticsearch-java-8.4.2.jar:na] 
at co.elastic.clients.elasticsearch.ElasticsearchAsyncClient.search(ElasticsearchAsyncClient.java:1492) ~[elasticsearch-java-8.4.2.jar:na] 

```

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [November 15, 2022, 9:17am UTC](https://discuss.elastic.co/t/caused-by-java-util-concurrent-cancellationexception-request-execution-cancelled/318864/2 "2022-11-15T09:17:06Z")

</div>

Thanks for the report. First of all, using the client version 8.x with the server version 7.x is not recommended. You should use the 7.x client.

About your problem, the information is sparse, but it may be caused by an issue in the http library when some error happens such as `OutOfMemoryError` when allocating a memory buffer.

Can you check if your logs contain messages like `I/O reactor terminated abnormally` or `I/O reactor status: STOPPED`?

---

<div class="post-metadata">

**Author:** ![tungli](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@tungli](https://discuss.elastic.co/u/tungli)\
**Post date:** [November 16, 2022, 1:35am UTC](https://discuss.elastic.co/t/caused-by-java-util-concurrent-cancellationexception-request-execution-cancelled/318864/4 "2022-11-16T01:35:53Z")

</div>

Thanks for your reply. We will try to lower the client。

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 14, 2022, 1:36am UTC](https://discuss.elastic.co/t/caused-by-java-util-concurrent-cancellationexception-request-execution-cancelled/318864/5 "2022-12-14T01:36:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
