Skip to content

fix: hold assigned port at start-up until Pg start command exec#252

Open
tzemanovic wants to merge 1 commit into
theseus-rs:mainfrom
tzemanovic:tomas/start-port-race
Open

fix: hold assigned port at start-up until Pg start command exec#252
tzemanovic wants to merge 1 commit into
theseus-rs:mainfrom
tzemanovic:tomas/start-port-race

Conversation

@tzemanovic

@tzemanovic tzemanovic commented Jul 20, 2026

Copy link
Copy Markdown

Hi,

Thanks for this crate! I'm using multiple embedded DBs concurrently with auto-assigned ports and it seems that there is a race condition in the start-up as randomly they fail to start. I found that the assigned port at start-up is not held open before the pg_ctl command uses it again, so another process may try re-use it in the meantime.

This fix instead tries to assign a random port directly for the pg_ctl command and retry 3 times on port conflict

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.

1 participant