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


##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java:
##########
@@ -350,13 +358,12 @@ private void processActionTaskForKey(Object key) throws 
Exception {
         long sequenceNumber = sequenceNumberKState.value();
         boolean isFinished;
         List<Event> outputEvents;
-        Optional<ActionTask> generatedActionTaskOpt;
+        Optional<ActionTask> generatedActionTaskOpt = Optional.empty();
         ActionState actionState =
                 maybeGetActionState(key, sequenceNumber, actionTask.action, 
actionTask.event);
-        if (actionState != null && 
actionState.getGeneratedActionTask().isEmpty()) {
+        if (actionState != null) {

Review Comment:
   > I assume this means we expect an incompleted action should not have a 
action state in the store?
   
   Yes, this is because I realize it will not be easy to serializer the 
ActionTask when the async action is only completed halfway. I will add a check 
before calling `maybePersistTaskResult()` so that unfinished job will not be 
persisted.



##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java:
##########
@@ -350,13 +358,12 @@ private void processActionTaskForKey(Object key) throws 
Exception {
         long sequenceNumber = sequenceNumberKState.value();
         boolean isFinished;
         List<Event> outputEvents;
-        Optional<ActionTask> generatedActionTaskOpt;
+        Optional<ActionTask> generatedActionTaskOpt = Optional.empty();
         ActionState actionState =
                 maybeGetActionState(key, sequenceNumber, actionTask.action, 
actionTask.event);
-        if (actionState != null && 
actionState.getGeneratedActionTask().isEmpty()) {
+        if (actionState != null) {

Review Comment:
   > I assume this means we expect an incompleted action should not have a 
action state in the store?
   
   Yes, this is because I realize it will not be easy to serializer the 
ActionTask when the async action is only completed halfway. I will add a check 
in `maybePersistTaskResult()` so that unfinished job will not be persisted.



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