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