letaoj commented on code in PR #138:
URL: https://github.com/apache/flink-agents/pull/138#discussion_r2350224493


##########
runtime/src/main/java/org/apache/flink/agents/runtime/context/RunnerContextImpl.java:
##########
@@ -119,4 +124,12 @@ public ReadableConfiguration getConfig() {
     public String getActionName() {
         return actionName;
     }
+
+    @Override
+    public List<MemoryUpdate> getAllMemoryUpdates() {
+        mailboxThreadChecker.run();
+        List<MemoryUpdate> memoryUpdatesCopy = List.copyOf(memoryUpdates);
+        memoryUpdates.clear();

Review Comment:
   I was thinking that the runner context will be reused over time so that it 
will be better to clear the memory updates each time after the task is 
persisted, but you are right, the runner context is recreated for every single 
action task so there is no need to clear the updates. 



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