Skip to content

MULTIPLE PATCH CSV FILE CancellationException #2642

Description

@ebett-bayer

We are running 40jobs in parallel reading the message from azure queue, compute then using a Feign client to PATCH a CSV file with 700 lines each.
After 30 min, we start to see Http connection cancelations in the pool. No http patch message is sent in those threads (at least they don't appear in logs:
Dependencies:
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.1.3'
implementation 'io.github.openfeign:feign-hc5:12.4'

at com.azure.messaging.servicebus.MessagePump.notifyMessage(MessagePump.java:157)
at com.azure.messaging.servicebus.MessagePump.lambda$handleMessage$3(MessagePump.java:142)
at com.azure.messaging.servicebus.implementation.instrumentation.ServiceBusReceiverInstrumentation.wrap(ServiceBusReceiverInstrumentation.java:169)
at com.azure.messaging.servicebus.implementation.instrumentation.ServiceBusReceiverInstrumentation.instrumentProcess(ServiceBusReceiverInstrumentation.java:104)
at com.azure.messaging.servicebus.MessagePump.handleMessage(MessagePump.java:135)
at com.azure.messaging.servicebus.MessagePump$RunOnWorker.lambda$apply$0(MessagePump.java:212)
at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:73)
at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:32)
at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:228)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.util.concurrent.CancellationException: null
at org.apache.hc.core5.concurrent.BasicFuture.getResult(BasicFuture.java:75)
at org.apache.hc.core5.concurrent.BasicFuture.get(BasicFuture.java:96)
at org.apache.hc.core5.pool.StrictConnPool$1.get(StrictConnPool.java:184)
at org.apache.hc.core5.pool.StrictConnPool$1.get(StrictConnPool.java:178)

at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$3.get(PoolingHttpClientConnectionManager.java:311)
at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.acquireEndpoint(InternalExecRuntime.java:109)
at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:125)
at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:113)
at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116)
at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at feign.hc5.ApacheHttp5Client.execute(ApacheHttp5Client.java:88)

What could be the reason?

Activity

  1. gromspys commented on Nov 5, 2024

    @gromspys
    Contributor

    As I see you use reactor in your project. Try to use feign-reactive if it's possible.

  2. ebett-bayer commented on Nov 5, 2024

    @ebett-bayer
    Author

    Reactor comes with the lib for Azure Service Bus consumption. I will see if I could exclue that dependency and try feign-reactive instead.
    Thanks, I will comment here after I can test it.

  3. ebett-bayer commented on Nov 5, 2024

    @ebett-bayer
    Author

    @gromspys could you tell me if this is all the changes needed?

    implementation ('com.azure:azure-messaging-servicebus:7.17.0') {
    exclude group: 'io.projectreactor', module: 'reactor-core'
    }
    implementation 'com.playtika.reactivefeign:feign-reactor-core:4.2.1'

  4. gromspys commented on Nov 6, 2024

    @gromspys
    Contributor

    Not sure if this will work. Since feign client is part of another library, there may be some client, connection pool, or thread pool configuration gaps. Try creating an issue in azure-messaging-servicebus and provide a minimal reproducible example.

  5. added
    bugUnexpected or incorrect behavior
    needs infoInformation is either missing or incomplete.
    spring-cloudIssues related to Spring Cloud OpenFeign
    on Jun 18, 2026
  6. velo commented on Jun 18, 2026

    @velo
    Member

    Thanks for the report. The stack trace points at Apache HttpClient 5 connection acquisition under Spring Cloud OpenFeign, but there is not enough here yet to tell whether Feign, hc5 pool configuration, Azure Service Bus concurrency, or the surrounding Reactor setup is the source.

    To move this forward, please add a minimal reproduction, the exact Feign/Spring Cloud versions in use, and the relevant client/pool timeout configuration. A PR with a failing test or reproducible sample would be the best path for a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected or incorrect behaviorneeds infoInformation is either missing or incomplete.spring-cloudIssues related to Spring Cloud OpenFeign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions