Issue with Spring Webclient 5: Executor not accepting a task

See original GitHub issue

I’m running a Spring webflux app which makes http calls to another service. Under high load (atleast this is when I see these errors), http call from webclient 5 to another service fails with java.lang.IllegalStateException: executor not accepting a task .

What could be the reason for this? Here’s my HTTP call implementation.

public Mono<Context> doHttp(WebClient webClient, WBConfig webClientConfiguration, String data, Context ctx) {
     return getWebclient(webClient, webClientConfiguration, data, ctx)
        .headers(httpHeaders -> logHeadersAndPayload(ctx, data, httpHeaders))
        .retrieve()
        .bodyToMono(Object.class)
        .publishOn(SchedulerHelper.getSharedPool())
        .onErrorResume(getErrorHandleFunction(webClientConfiguration, ctx, taskName))
        .retryWhen(buildRetrySpec(webClientConfiguration))
        .flatMap(getResponseToContextMonoFunction(ctx, taskName, startTime));
}

SchedulerHelper class returns the following scheduler with configuration. Please note that this is shared app wise. This is created when the app boots up.

Schedulers.newBoundedElastic(100, Integer.MAX_VALUE, new ThreadFactoryBuilder().setNameFormat("http-threads").build(), 60)

I do not get any other information in the stack trace exception thatI have posted this on SO as well. @simonbasle anything that we need to configure?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pavanpkp33commented, Jun 15, 2022

@violetagg - Im trying to push debug level code to my PROD instances. It may take some time for next rollout but i will keep you posted.

0reactions
violetaggcommented, Jul 18, 2022

@pavanpkp33 I’m closing this one. We can reopen it when there is more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

executor not accepting a task" in JUnit - Stack Overflow
The problem is that once the function testWebClient() finish, all the asynchronous process are closed. In this case you are using WebClient ...
Read more >
Concurrency in Spring WebFlux - Baeldung
If we're running WebClient on the Reactor Netty, it shares the event loop that Netty uses for the server. Therefore, in this case,...
Read more >
IllegalStateException by calling the webClient request ...
It looks like your application is in a shutting down state therefore Netty executor doesn't accept tasks (requests to be executed).
Read more >
reactor/reactor-netty - Gitter
Hi Team, i am facing one issue with Spring Reactive Webclient I am running load of a microservice API, which involves calling other...
Read more >
Spring Cloud Sleuth customization
Executor, ExecutorService, and ScheduledExecutorService. 3. HTTP Client Integration ... Sleuth does not work with parallelStream() out of the box.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found