Re: retry shm attach for windows (WAS: Re: OK, so culicidae is *still* broken)

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: retry shm attach for windows (WAS: Re: OK, so culicidae is *still* broken)
Date: 2017-06-01 17:06:10
Message-ID: 1280d427-b024-25db-4334-308999b53f9c@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/06/17 15:25, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> So, are you going to, perhaps, commit this? Or who is picking this up?
>
>> /me knows precious little about Windows.
>
> I'm not going to be the one to commit this either, but seems like someone
> should.
>

The new code does not use any windows specific APIs or anything, it just
adds retry logic for reattaching when we do EXEC_BACKEND which seems to
be agreed way of solving this. I do have couple of comments about the
code though.

The new parameter retry_count in PGSharedMemoryReAttach() seems to be
only used to decide if to log reattach issues so that we don't spam log
when retrying, but this fact is not mentioned anywhere.

Also, I am not excited about following coding style:
> + if (!pgwin32_ReserveSharedMemoryRegion(pi.hProcess))
> + continue;
> + else
> + {

Amit, if you want to avoid having to add the curly braces for single
line while still having else, I'd invert the expression in the if ()
statement so that true comes first. It's much less ugly to have curly
braces part first and the continue statement in the else block IMHO.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2017-06-01 17:08:33 Re: [BUGS] Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Álvaro Hernández Tortosa 2017-06-01 16:58:48 Re: [HACKERS] Channel binding support for SCRAM-SHA-256