Re: [PATCH] Make ENOSPC not fatal in semaphore creation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mp39590(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Make ENOSPC not fatal in semaphore creation
Date: 2021-10-17 14:29:24
Message-ID: 1409550.1634480964@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

mp39590(at)gmail(dot)com writes:
> We might be in situation when we have "just enough" semaphores in the
> system limit to start but previously crashed unexpectedly, in that case
> we won't be able to start again - semget() will return ENOSPC, despite
> the semaphores are ours, and we can recycle them, so check this
> situation and try to remove the semaphore, if we are unable - give up
> and abort.

AFAICS, this patch could be disastrous. What if the semaphore in
question belongs to some other postmaster?

Also, you haven't explained why the existing (and much safer) recycling
logic in IpcSemaphoreCreate doesn't solve your problem.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikhail 2021-10-17 14:41:39 Re: [PATCH] Make ENOSPC not fatal in semaphore creation
Previous Message mp39590 2021-10-17 14:11:28 [PATCH] Make ENOSPC not fatal in semaphore creation