{"record":{"id":"3866f879e65ddc27","repo":"flowable/flowable-engine","slug":"none-of-the-available-futures-completed-within-the","errorCode":null,"errorMessage":"None of the available futures completed within the max timeout of ","messagePattern":"None of the available futures completed within the max timeout of ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/agenda/WaitForAnyFutureToFinishOperation.java","lineNumber":70,"sourceCode":"        }\n        try {\n            CompletableFuture<Object> anyOfFuture = CompletableFuture.anyOf(anyOfFutures);\n            if (timeout == null) {\n                // This blocks until at least one is future is done\n                anyOfFuture.get();\n            } else {\n                try {\n                    // This blocks until at least one is future is done or the timeout is reached\n                    anyOfFuture.get(timeout.toMillis(), TimeUnit.MILLISECONDS);\n                } catch (TimeoutException e) {\n                    // When the timeout is reached we need to cancel all the futures that are not done\n                    for (ExecuteFutureActionOperation<?> futureOperation : futureOperations) {\n                        if (!futureOperation.isDone()) {\n                            // If there was a timeout then we need to cancel all the futures that have not completed already\n                            futureOperation.getFuture().cancel(true);\n                        }\n                    }\n                    throw new FlowableException(\"None of the available futures completed within the max timeout of \" + timeout, e);\n                }\n            }\n\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw new FlowableException(\"Future was interrupted\", e);\n        } catch (ExecutionException e) {\n            // If there was any exception then it will be handled by the appropriate action\n        }\n\n        // Now go through future operation and schedule them for execution if they are done\n        for (ExecuteFutureActionOperation<?> futureOperation : futureOperations) {\n            if (futureOperation.isDone()) {\n                // If it is done then schedule it for execution\n                agenda.planOperation(futureOperation);\n            } else {\n                // Otherwise plan a new future operation\n                agenda.planFutureOperation((CompletableFuture<Object>) futureOperation.getFuture(),","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/agenda/WaitForAnyFutureToFinishOperation.java#L52-L88","documentation":"Thrown by WaitForAnyFutureToFinishOperation.run when ExecutionException-triggered timeout handling finds that none of the planned future operations completed within the configured max timeout; the engine then cancels all incomplete futures and raises this FlowableException. It signals an async wait that expired without any progress.","triggerScenarios":"Agenda-driven async waiting where all ExecuteFutureActionOperation futures stay incomplete past the max timeout (e.g. a stuck async job, dead async executor, or an unreasonably small timeout configured).","commonSituations":"Async executor not running or saturated so futures never complete; downstream services too slow for the configured timeout; thread pool exhaustion blocking future completion.","solutions":["Increase the max wait timeout to a value consistent with the slowest expected async operation.","Verify the async executor is running and processing jobs; check thread pool saturation and queue backlogs.","Debug why the awaited futures hang (network calls, locks) and add their own timeouts so they fail fast.","Handle FlowableException around the wait and implement retry/backoff for transient downstream slowness."],"exampleFix":"// before\nnew WaitForAnyFutureToFinishOperation(agenda, ops, Duration.ofSeconds(1));\n// after\nnew WaitForAnyFutureToFinishOperation(agenda, ops, Duration.ofSeconds(60));","handlingStrategy":"try-catch","validationCode":"if (timeout != null && timeout.compareTo(Duration.ofSeconds(5)) < 0) log.warn(\"Agenda wait timeout {} is very small; risk of 'None of the available futures completed'\", timeout);","typeGuard":null,"tryCatchPattern":"try {\n  waitForOperation.run();\n} catch (FlowableException e) {\n  if (e.getMessage().startsWith(\"None of the available futures completed\")) {\n    // retry or escalate: check async executor health\n    return;\n  }\n  throw e;\n}","preventionTips":["Size the max wait timeout to cover the slowest expected async operation.","Monitor async executor thread pool saturation and queue depth.","Give awaited futures their own inner timeouts so they fail fast rather than hang.","Implement retry with backoff around agenda waits that hit timeout."],"tags":["timeout","future","async","agenda"],"backgroundTag":"request-timeout","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}