{"record":{"id":"135377d328076c7f","repo":"apache/seatunnel","slug":"can-t-apply-resource-request-r","errorCode":null,"errorMessage":"can't apply resource request: ${r}","messagePattern":"can't apply resource request: (.+?)","errorType":"exception","errorClass":"NoEnoughResourceException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/ResourceRequestHandler.java","lineNumber":202,"sourceCode":"    private List<CompletableFuture<SlotAndWorkerProfile>> requestSlots(\n            List<ResourceProfile> requestProfile) {\n        List<CompletableFuture<SlotAndWorkerProfile>> allRequestFuture = new ArrayList<>();\n\n        for (int i = 0; i < requestProfile.size(); i++) {\n            ResourceProfile r = requestProfile.get(i);\n            Optional<WorkerProfile> workerProfile = preCheckWorkerResource(r);\n            if (workerProfile.isPresent()) {\n                // request slot to member\n                CompletableFuture<SlotAndWorkerProfile> internalCompletableFuture =\n                        singleResourceRequestToMember(i, r, workerProfile.get());\n                allRequestFuture.add(internalCompletableFuture);\n            } else {\n                // if no worker can provide the resource, we should return a failed future\n                LOGGER.fine(\"pre check worker resource failed, can't apply resource request: \" + r);\n                allRequestFuture.add(\n                        CompletableFuture.supplyAsync(\n                                () -> {\n                                    throw new NoEnoughResourceException(\n                                            \"can't apply resource request: \" + r);\n                                }));\n            }\n        }\n        return allRequestFuture;\n    }\n\n    private void completeRequestWithException(Throwable e) {\n        if (completableFuture.completeExceptionally(e)) {\n            releaseAllResourceInternal();\n        }\n    }\n\n    private void addSlotToCacheMap(int index, SlotProfile slotProfile) {\n        // null value means the slot request failed, no suitable slot found\n        if (null != slotProfile) {\n            resultSlotProfiles.put(index, slotProfile);\n            if (resultSlotProfiles.size() == resourceProfile.size()) {","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/ResourceRequestHandler.java#L184-L220","documentation":"During slot pre-check, requestSlots iterates the requested ResourceProfiles and picks a worker whose remaining capacity can satisfy each profile. When no worker can provide the requested resource, it adds a failed future that throws NoEnoughResourceException so the whole request fails fast without retry churn.","triggerScenarios":"ResourceRequestHandler.requestSlots called with a ResourceProfile larger than any worker's unallocated CPU/memory, or with tags that no live worker matches.","commonSituations":"Job declares higher cpu/memory than the biggest worker; all workers busy; tag-based scheduling with tags not configured on any node; workers newly joined but not yet registered.","solutions":["Reduce the job's per-pipeline resource declaration to fit worker capacity","Add/verify node tags so workers match the requested tags","Scale the cluster: add worker nodes or increase slot counts per worker","Check worker available resources via REST to confirm the shortfall"],"exampleFix":"// before: tags = [\"gpu\"] with no gpu worker\nsource { ... }\n// after: remove tag or tag a worker with gpu\nsource { ... } // and ensure worker node has matching tag","handlingStrategy":"validation","validationCode":"// pre-check worker capacity\nGET /hazelcast/rest/maps/worker-profile  # confirm cpu/mem/tags satisfy ResourceProfile","typeGuard":null,"tryCatchPattern":"try {\n    future.get();\n} catch (ExecutionException e) {\n    if (e.getCause() instanceof NoEnoughResourceException) {\n        log.warn(\"No worker satisfies profile: \" + profile);\n    }\n}","preventionTips":["Keep per-pipeline resource requests within single-worker capacity","Configure node tags on workers that job tags reference","Scale workers before submitting large jobs"],"tags":["zeta-engine","resource-allocation","pre-check"],"backgroundTag":"insufficient-resources","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}