diogosilva30 commented on code in PR #65943:
URL: https://github.com/apache/airflow/pull/65943#discussion_r3240811310
##########
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:
Removed `should_poll_logs` and using `is_running` directly ✅
--
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]