You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/05/19 09:58:25 UTC
[GitHub] [airflow] potiuk commented on a diff in pull request #31403: Replace daemon Thread in dev-mode of breeze start-airflow with forking
potiuk commented on code in PR #31403:
URL: https://github.com/apache/airflow/pull/31403#discussion_r1198777379
##########
dev/breeze/src/airflow_breeze/utils/run_utils.py:
##########
@@ -470,7 +471,15 @@ def run_compile_www_assets(
f"{WWW_ASSET_OUT_DEV_MODE_FILE if dev else WWW_ASSET_OUT_FILE}\n"
)
if run_in_background:
- thread = Thread(daemon=True, target=_run_compile_internally, args=(command_to_execute, dev))
- thread.start()
+ pid = os.fork()
+ if pid:
+ # Parent process - send signal to process group of the child process
+ atexit.register(os.killpg, pid, signal.SIGTERM)
+ else:
+ # Check if we are not a group leader already (We should not be)
+ if os.getpid() != os.getsid(0):
+ # and create a new process group where we aer the leader
Review Comment:
Yeah. I am slightly dyslexsic :) that's a fact :). That's why I love spellchecking pre-commits -but they don't work on such short words :).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org