pierrejeambrun commented on code in PR #31403:
URL: https://github.com/apache/airflow/pull/31403#discussion_r1198764707


##########
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:
   ```suggestion
                   # and create a new process group where we are the leader
   ```



-- 
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]

Reply via email to