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/14 19:29:54 UTC

[airflow] branch v1-10-test updated: 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


The following commit(s) were added to refs/heads/v1-10-test by this push:
     new 356ffbc  Improve process terminating in scheduler_job (#8064)
356ffbc is described below

commit 356ffbc41177fcd3517750c4f5d3d8db240f127a
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()