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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-05-26 12:20:45
Message-ID: CAA4eK1+duSYgaQy5TMfHCPyApChxY0MXMtT55LmOq9kw8TSDTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 26, 2017 at 5:30 AM, Tsunakawa, Takayuki
<tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
> From: pgsql-hackers-owner(at)postgresql(dot)org
>> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Amit Kapila
>> Yes, I also share this opinion, the shm attach failures are due to
>> randomization behavior, so sleep won't help much. So, I will change the
>> patch to use 100 retries unless people have other opinions.
>
> Perhaps I'm misunderstanding, but I thought it is not known yet whether the cause of the original problem is ASLR. I remember someone referred to anti-virus software and something else.
>

We are here purposefully trying to resolve the randomize shm
allocation behavior due to ASLR. The original failure was on a linux
machine and is resolved. We presumably sometimes get the failures [1]
due to this behavior.

> I guessed that the reason Noah suggested 1 - 5 seconds of retry is based on the expectation that the address space might be freed by the anti-virus software.
>

Noah is also suggesting to have a retry count, read his mail above in
this thread and refer to his comment ("Thus, measuring time is
needless complexity; retry count is a suitable proxy.")

I think the real question here is, shall we backpatch this fix or we
want to do this just in Head or we want to consider it as a new
feature for PostgreSQL-11. I think it should be fixed in Head and the
change seems harmless to me, so we should even backpatch it.

[1] - https://www.postgresql.org/message-id/14121.1485360296%40sss.pgh.pa.us

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-05-26 12:24:29 Re: retry shm attach for windows (WAS: Re: OK, so culicidae is *still* broken)
Previous Message tushar 2017-05-26 12:17:01 Re: logical replication - still unstable after all these months