jscheffl commented on code in PR #65943:
URL: https://github.com/apache/airflow/pull/65943#discussion_r3236869479


##########
providers/edge3/src/airflow/providers/edge3/cli/dataclasses.py:
##########
@@ -72,17 +73,48 @@ class Job:
     """Holds all information for a task/job to be executed as bundle."""
 
     edge_job: EdgeJobFetched
-    process: Process
+    # Process can be either a subprocess.Popen (for the spawn path) or a
+    # multiprocessing.Process (for the fork path)
+    process: subprocess.Popen | Process
     logfile: Path
     logsize: int = 0
     """Last size of log file, point of last chunk push."""
+    stderr_file_path: Path | None = None
+    """Path to file where error details are written on failure (stderr for 
subprocess path, traceback text for fork path)."""
 
     @property
     def is_running(self) -> bool:
         """Check if the job is still running."""
+        if isinstance(self.process, subprocess.Popen):
+            return self.process.poll() is None
         return self.process.is_alive()
 
     @property
     def is_success(self) -> bool:
         """Check if the job was successful."""
+        if isinstance(self.process, subprocess.Popen):
+            return self.process.returncode == 0
         return self.process.exitcode == 0
+
+    @property
+    def should_poll_logs(self) -> bool:
+        """Check if logs should be pushed while waiting for job completion."""
+        return self.is_running

Review Comment:
   Is this really needed? Basically it is only an alias to `is_running`. I see 
low benefit and rather keep only 1 property.



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