joeyutong commented on code in PR #944:
URL: https://github.com/apache/flink-agents/pull/944#discussion_r3886379261


##########
python/flink_agents/runtime/flink_runner_context.py:
##########
@@ -752,14 +752,16 @@ def config(self) -> ReadableConfiguration:
 
     @override
     def close(self) -> None:
-        if self.long_term_memory is not None:
-            self.long_term_memory.close()
-
-        if self.__resource_cache is not None:
-            try:
-                self.__resource_cache.close()
-            finally:
-                self.__resource_cache = None
+        ltm = self.__ltm
+        self.__ltm = None
+        try:
+            if ltm is not None:
+                ltm.close()
+        finally:
+            resource_cache = self.__resource_cache
+            self.__resource_cache = None
+            if resource_cache is not None:
+                resource_cache.close()

Review Comment:
   Thanks again for flagging this failure-ordering gap. After #987 merged, I 
rebased #944 onto its cleanup ladders and updated this path to reuse the same 
`_failure_of` / `_first_or_logged` helpers. Ordinary `Exception`s now keep the 
first failure and log later failures, while `SystemExit` and 
`KeyboardInterrupt` propagate instead of being demoted behind an earlier 
cleanup failure. The tests now cover both ordinary double failure and the 
interpreter-exit case. Updated in f0bf1e86.



-- 
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