Skip to content

Commit

Permalink
[AIRFLOW-5354] Reduce scheduler CPU usage from 100% (apache#7552)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashb authored and kaxil committed Feb 28, 2020
1 parent d56b3c5 commit ce76213
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/utils/dag_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ def heartbeat(self):
pass

def wait_until_finished(self):
while self._parent_signal_conn.poll():
"""Waits until DAG parsing is finished."""
while self._parent_signal_conn.poll(timeout=None):
try:
result = self._parent_signal_conn.recv()
except EOFError:
Expand Down Expand Up @@ -630,7 +631,7 @@ def harvest_simple_dags(self):
:return: List of parsing result in SimpleDag format.
"""
# Receive any pending messages before checking if the process has exited.
while self._parent_signal_conn.poll():
while self._parent_signal_conn.poll(timeout=0.01):
try:
result = self._parent_signal_conn.recv()
except (EOFError, ConnectionError):
Expand Down

0 comments on commit ce76213

Please sign in to comment.