Re: Dynamic Shared Memory stuff

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Dynamic Shared Memory stuff
Дата
Msg-id CA+TgmoYm4+QWQy1u4oLXX0GFHKOVWFMgVsmrpC4pvT1b=MqhJg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Dynamic Shared Memory stuff  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: Dynamic Shared Memory stuff  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Tue, Apr 15, 2014 at 12:33 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Mon, Apr 14, 2014 at 10:03 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Sat, Apr 12, 2014 at 1:32 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>>> I have checked that other place in code also check handle to
>>> decide if API has failed.  Refer function PGSharedMemoryIsInUse().
>>> So I think fix to call GetLastError() after checking handle is okay.
>>> Attached patch fixes this issue.  After patch, the server shows below
>>> log which is exactly what is expected from test_shm_mq
>>
>> In PostgreSQL code, hmap == NULL, rather than !hmap, is the preferred
>> way to test for a NULL pointer.  I notice that the !hmap style is used
>> throughout this code, so I guess cleaning that up is a matter for a
>> separate commit.
>
> I think in that case we might want to cleanup some other similar usage
> (PGSharedMemoryCreate) of !hmap.

Ah.  Well, in that case maybe we should just leave it alone, since
it's been like that forever and nobody's cared until now.

>> For the create case, I'm wondering if we should put the block that
>> tests for !hmap *before* the _dosmaperr() and check for EEXIST.  What
>> is your opinion?
>
> Either way is okay, but I think the way you are suggesting is better as it
> will make code consistent with other place (PGSharedMemoryCreate()).

OK, can you prepare a patch?


-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Need Multixact Freezing Docs
Следующее
От: Josh Berkus
Дата:
Сообщение: How can we make beta testing better?