Skip to content

fix(sdk): Pg0.start() no longer hangs on Linux/macOS - #48

Merged
nicoloboschi merged 2 commits into
mainfrom
fix/sdk-start-hang
Nov 4, 2026
Merged

nicoloboschi merged 2 commits into
mainfrom
fix/sdk-start-hang

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Fixes #45.

pg0 start spawns PostgreSQL, which inherits pg0's stdout/stderr. On Linux/macOS the SDK captured them with pipes, so when a child kept the pipe open, subprocess.run waited forever even though pg0 had exited. The Windows branch already avoided this by writing to temp files. This uses that path on every platform and keeps the Windows-only CREATE_NO_WINDOW flag.

Test: test_runner_does_not_wait_for_children_holding_stdio uses a fake pg0 that leaves a sleep 30 child holding stdout. It takes 30s and fails on main, and passes in 0.3s with this change.

@nicoloboschi
nicoloboschi merged commit 73b3a7a into main Nov 4, 2026
15 checks passed
@nicoloboschi
nicoloboschi deleted the fix/sdk-start-hang branch November 4, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python SDK: Pg0.start() hangs forever on Linux — daemonized PostgreSQL inherits subprocess pipes (deadlock the Windows branch already fixes)

1 participant