Issue with Spring Webclient 5: Executor not accepting a task
See original GitHub issueI’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:
- Created a year ago
- Comments:7 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
@pavanpkp33 I’m closing this one. We can reopen it when there is more information.