You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/08/15 03:33:05 UTC

[airflow] 30/47: Improve process terminating in scheduler_job (#8064)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4457ad58ae1cd7ff7ad1da3c48e3d7566efc964e
Author: Kamil BreguĊ‚a <mi...@users.noreply.github.com>
AuthorDate: Fri Apr 3 06:02:31 2020 +0200

    Improve process terminating in scheduler_job (#8064)
    
    (cherry picked from commit 94480a731d141df4dd7ed91b4b93952d8e07c5c4)
---
 airflow/jobs/scheduler_job.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/airflow/jobs/scheduler_job.py b/airflow/jobs/scheduler_job.py
index 685b57f..ecc0dc6 100644
--- a/airflow/jobs/scheduler_job.py
+++ b/airflow/jobs/scheduler_job.py
@@ -222,7 +222,12 @@ class DagFileProcessor(AbstractDagFileProcessor, LoggingMixin, MultiprocessingSt
 
         self._process.terminate()
         # Arbitrarily wait 5s for the process to die
-        self._process.join(5)
+        if six.PY2:
+            self._process.join(5)
+        else:
+            from contextlib import suppress
+            with suppress(TimeoutError):
+                self._process._popen.wait(5)  # pylint: disable=protected-access
         if sigkill:
             self._kill_process()
         self._parent_channel.close()