Matthew-DWM commented on code in PR #9364:
URL: https://github.com/apache/texera/pull/9364#discussion_r4555851789


##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/pythonworker/PythonWorkflowWorker.scala:
##########
@@ -169,6 +187,31 @@ class PythonWorkflowWorker(
     )
   }
 
+  override def receive: Receive = handlePythonFailure orElse super.receive
+
+  // Throwing hands the failure to the coordinator's supervisor, which fails 
the execution.
+  private def handlePythonFailure: Receive = {
+    case PythonWorkflowWorker.PythonProcessExited(code) =>
+      throw new WorkflowRuntimeException(
+        
PythonWorkflowWorker.describeUnexpectedExit(workerConfig.workerId.name, code),
+        null,
+        Some(workerConfig.workerId)
+      )
+    case PythonWorkflowWorker.PythonClientFailed(cause) =>
+      val process = pythonServerProcess
+      // When the process is gone, its exit is the reason the client stopped; 
report that.
+      val message =
+        if (process != null && !process.isAlive()) {

Review Comment:
   Done: when the client fails while the process still looks alive, the handler 
waits up to 500 ms for it to exit before choosing the message, so a SIGKILL 
during a Flight call reports code 137. Covered by "report the exit code when 
its client stops just before the killed process is seen to exit".



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