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


##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java:
##########
@@ -504,28 +549,18 @@ private void processActionTaskForKey(Object key, String 
contextKey) throws Excep
                 outputEvents = actionTaskResult.getOutputEvents();
                 generatedActionTaskOpt = 
actionTaskResult.getGeneratedActionTask();
                 if (isFinished) {
-                    notifyActionFinished(actionTask);
+                    notifyActionResultPersisted(actionTask);
                 }
             } catch (Throwable t) {
-                try {
-                    notifyActionFailed(actionTask, t);
-                } finally {
-                    contextManager.completeActionExecution(actionTask);
-                }
+                notifyActionFailed(actionTask, t);

Review Comment:
   Could a listener exception in `notifyActionStarted` leave an unpaired 
`started` execution? `EventLogTaskLifecycleListener` may already have emitted 
`started`, but that call occurs before this failure boundary, so a later Java 
or Python listener failure exits without reaching `notifyActionFailed`.



##########
runtime/src/main/java/org/apache/flink/agents/runtime/trace/EventLogTaskLifecycleListener.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.runtime.trace;
+
+import org.apache.flink.agents.api.trace.ExecutionLifecycleEvents;
+import org.apache.flink.agents.api.trace.ExecutionReporter;
+import org.apache.flink.agents.runtime.lifecycle.TaskLifecycleListener;
+import org.apache.flink.agents.runtime.operator.ActionTask;
+import org.apache.flink.annotation.Internal;
+
+/**
+ * Bridges the operator's action lifecycle callbacks onto the event log, 
emitting the execution
+ * lifecycle events independently from the business-event router. Registered 
ahead of any

Review Comment:
   This comment guarantees that the Event Log listener is registered ahead of 
every user listener. However, `registerEventLogListeners()` ultimately appends 
it with `taskLifecycleListeners.add(...)`, so a listener registered before 
`open()` remains ahead of it and can fail before Event Log observes the 
callback. The implementation therefore does not appear to uphold the stated 
ordering contract.



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