Fix: Wait for the subprocess that opens the browser window, preventing zombie processes

Fixes #1488
This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2026-06-02 11:36:05 +02:00
1 parent 8a54795848
commit 02c3d6bb78
2 files changed
+3 -1

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ Status of the `main` branch. Changes prior to the next official version change w
This allows the dashboard to display the configuration while the project provided at startup is still initialising. #1064 This allows the dashboard to display the configuration while the project provided at startup is still initialising. #1064
- Fix empty executions queue displaying "Loading..." - Fix empty executions queue displaying "Loading..."
- Tray manager: Add NixOS-support for AppIndicator-based trays (e.g., most Wayland-trays) to the package in flake.nix. - Tray manager: Add NixOS-support for AppIndicator-based trays (e.g., most Wayland-trays) to the package in flake.nix.
- Fix: Wait for the subprocess that opens the browser window, preventing zombie processes #1488
# v1.5.3 (2026-05-26) # v1.5.3 (2026-05-26)
+2 -1
View File
@@ -813,13 +813,14 @@ def open_url_in_browser(url: str, use_subprocess: bool = False) -> None:
if use_subprocess: if use_subprocess:
# Use a subprocess to avoid any output from webbrowser.open being written to stdout # Use a subprocess to avoid any output from webbrowser.open being written to stdout
try: try:
subprocess.Popen( p = subprocess.Popen(
[sys.executable, "-c", f"import webbrowser; webbrowser.open({url!r})"], [sys.executable, "-c", f"import webbrowser; webbrowser.open({url!r})"],
stdin=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
start_new_session=False, start_new_session=False,
) )
threading.Thread(target=p.wait, daemon=True).start()
except Exception as e: except Exception as e:
# Subprocess creation can fail in rare cases (e.g. on some Linux systems; possibly subprocess/glibc bug) # Subprocess creation can fail in rare cases (e.g. on some Linux systems; possibly subprocess/glibc bug)
# See #1363 # See #1363