{"record":{"id":"84fa28649141becd","repo":"flowable/flowable-engine","slug":"call-was-interrupted","errorCode":null,"errorMessage":"Call was interrupted","messagePattern":"Call was interrupted","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-http-common/src/main/java/org/flowable/http/common/api/client/AsyncExecutableHttpRequest.java","lineNumber":33,"sourceCode":"import java.io.IOException;\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ExecutionException;\n\nimport org.flowable.common.engine.api.FlowableException;\nimport org.flowable.http.common.api.HttpResponse;\n\n/**\n * @author Filip Hrisafov\n */\npublic interface AsyncExecutableHttpRequest extends ExecutableHttpRequest {\n\n    @Override\n    default HttpResponse call() {\n        try {\n            return callAsync().get();\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw new FlowableException(\"Call was interrupted\", e);\n        } catch (ExecutionException e) {\n            Throwable cause = e.getCause();\n            if (cause instanceof RuntimeException) {\n                throw (RuntimeException) cause;\n            } else if (cause instanceof IOException) {\n                throw new FlowableException(\"IO exception occurred\", cause);\n            } else {\n                throw new FlowableException(\"execution exception\", cause);\n            }\n        }\n    }\n\n    CompletableFuture<HttpResponse> callAsync();\n}\n","sourceCodeStart":15,"sourceCodeEnd":48,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-http-common/src/main/java/org/flowable/http/common/api/client/AsyncExecutableHttpRequest.java#L15-L48","documentation":"AsyncExecutableHttpRequest.call() blocks on callAsync().get(). If the waiting thread is interrupted while blocked, the library re-asserts the interrupt flag and wraps the InterruptedException in a FlowableException with message \"Call was interrupted\".","triggerScenarios":"A thread executing the asynchronous HTTP call synchronously via call() is interrupted (Thread.interrupt()) while parked in CompletableFuture.get().","commonSituations":"Flowable engine shutting down or cancelling a job/executing thread pool; timeouts in the surrounding framework that interrupt worker threads; application shutdown interrupting in-flight HTTP activity executions.","solutions":["Check why the executing thread was interrupted (shutdown, cancellation, timeout) and address the upstream trigger.","Preserve cancellation semantics: do not swallow the exception; let the FlowableException propagate or retry the call if the operation is idempotent.","Avoid interrupting worker threads that run HTTP activities, or use callAsync() with a timeout instead of blocking call()."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    HttpResponse response = request.call();\n} catch (FlowableException e) {\n    if (e.getCause() instanceof InterruptedException) {\n        Thread.currentThread().interrupt(); // restore interrupt status\n        // abort or reschedule the work\n    }\n}","preventionTips":["Avoid interrupting threads that execute blocking HTTP calls during shutdown; drain gracefully","Prefer callAsync() with a timeout over interrupt-based cancellation","Keep the interrupt status when catching InterruptedException in surrounding code","Make the HTTP operation idempotent so it can be safely retried after cancellation"],"tags":["http","interruption","async","threading"],"backgroundTag":"request-timeout","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}