davidzollo commented on code in PR #10304:
URL: https://github.com/apache/seatunnel/pull/10304#discussion_r2708955582


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/ResourceRequestHandler.java:
##########
@@ -285,14 +307,32 @@ private void applyByDynamicWorker(Map<String, String> 
tags) {
     }
 
     private void releaseAllResourceInternal() {
-        LOGGER.warning("apply resource not success, release all already 
applied resource");
-        new ArrayList<>(resultSlotProfiles.keySet())
+        int appliedCount = resultSlotProfiles.size();
+        int requiredCount = resourceProfile.size();
+
+        String slotIds =
+                resultSlotProfiles.values().stream()
+                        .map(
+                                slot ->
+                                        String.format(
+                                                "Slot-%d@%s", 
slot.getSlotID(), slot.getWorker()))
+                        .collect(Collectors.joining(", "));
+
+        LOGGER.warning(
+                String.format(
+                        "Apply resource not success for job: %d, required: %d 
slots, applied: %d slots, "
+                                + "releasing slots: [%s], remaining: %d slots 
not assigned",
+                        jobId, requiredCount, appliedCount, slotIds, 
requiredCount - appliedCount));
+
+        resultSlotProfiles.values().stream()
+                .filter(Objects::nonNull)
                 .forEach(
-                        index -> {
-                            SlotProfile profile = 
resultSlotProfiles.remove(index);
-                            if (profile != null) {
-                                resourceManager.releaseResource(jobId, 
profile);
-                            }
+                        profile -> {
+                            LOGGER.fine(
+                                    String.format(
+                                            "Releasing slot %d for job %d from 
worker %s",
+                                            profile.getSlotID(), jobId, 
profile.getWorker()));
+                            resourceManager.releaseResource(jobId, profile);

Review Comment:
   lack `resultSlotProfiles.remove`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to