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