Re: ipc-daemon - Mailing list pgsql-cygwin

From Peter Eisentraut
Subject Re: ipc-daemon
Date
Msg-id Pine.LNX.4.44.0211042014280.1395-100000@localhost.localdomain
Whole thread Raw
In response to Re: ipc-daemon  (Jason Tishler <jason@tishler.net>)
Responses Re: [HACKERS] ipc-daemon
List pgsql-cygwin
Jason Tishler writes:

>     1. If ipc-daemon is not running, then cygipc's shmget() will return
>        EACCES.
>     2. This causes PostgreSQL's InternalIpcMemoryCreate() to return
>        NULL.
>     3. This causes PostgreSQL's PGSharedMemoryCreate() to spin looking
>        for accessible shared memory which it will never find.

To me, this is a bug in PostgreSQL.  A comment in
InternalIpcMemoryCreate() says

         * Fail quietly if error indicates a collision with existing
         * segment. One would expect EEXIST, given that we said IPC_EXCL,
         * but perhaps we could get a permission violation instead?

I tend to think that the answer to that question is No.

> After reading the shmget() man page, I choose to return ENOSPC.  Is
> there a better choice?  Such as ENOMEM?

My first thought was ENOSYS (system call not implemented -- what BSD
kernels tend to return if you didn't compile them with SysV IPC support),
but that isn't a clearly superior choice either.  Fixing PostgreSQL is
probably better and quicker to yield a return.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-cygwin by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Problem configuring Postgres under Cygwin
Next
From: Jason Tishler
Date:
Subject: Re: Problem configuring Postgres under Cygwin