Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Panella <gavinpanella(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: `pg_ctl init` crashes when run concurrently; semget(2) suspected
Date: 2025-08-11 15:12:17
Message-ID: 2825802.1754925137@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> My first thought about fixing it is to go ahead and retry after
> EINVAL, but keep a count of failures, and give up after 100 or 1000
> or so. This'd be safer in any case --- it's not really great that
> IpcSemaphoreCreate is willing to retry an infinite number of times.

Concretely, about like the attached. I don't have any clear idea
about what loop limit to use, but I think we do need one.

regards, tom lane

Attachment Content-Type Size
cope-with-EINVAL-from-semget.patch text/x-diff 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2025-08-11 15:41:23 Re: Possible inaccurate description of wal_compression in docs
Previous Message Robert Haas 2025-08-11 15:03:29 Re: Foreign key isolation tests