Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Gavin Panella <gavinpanella@gmail.com>, pgsql-hackers@postgresql.org
Date: 2025-08-12T20:19:02Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes: > On Mon, Aug 11, 2025 at 10:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> A bit more research later: OpenBSD behaves like NetBSD, while >> FreeBSD behaves like Linux. So that's pretty inconclusive about >> what the aboriginal behavior was. I also found that OpenIndiana >> behaves like Linux. > Out of curiosity, FreeBSD changed that in 2016: > https://github.com/freebsd/freebsd-src/commit/f00fb5457ebf5907055e420d803ac67fb098109e Hah, so that lends weight to the theory that this is an ancient Berkeley mistake. I wonder how hard it would be to convince POSIX that they should be more specific about which errno is expected here. In the meantime, though, we'll have to deal with the existing behavior for years to come. So I'll go ahead with that patch. I like having a loop limit there anyway --- I was never exactly convinced that retrying indefinitely was a good idea. regards, tom lane
Commits
-
Don't treat EINVAL from semget() as a hard failure.
- 21fddb3d7690 19 (unreleased) landed
- f4c0883448d8 15.15 landed
- e67d5f7baa7d 16.11 landed
- e3b3fa863810 13.23 landed
- b3d6e8b63bc1 14.20 landed
- ab92f0e7f7d7 17.7 landed
- 787cd2b7d5cd 18.0 landed
-
Give up on running with NetBSD/OpenBSD's default semaphore settings.
- 810a8b1c8051 18.0 cited