joeyutong commented on code in PR #944:
URL: https://github.com/apache/flink-agents/pull/944#discussion_r3759217003
##########
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:
Good catch. I replaced the try/finally propagation with explicit
aggregation: the long-term-memory failure remains the primary exception, while
a later resource-cache failure is retained in its __context__. The new
double-failure test asserts both identities and also verifies that repeated
close() remains a no-op. Fixed in fc4c0fb3.
--
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]