Re: [HACKERS] Hang in pldebugger after git commit : 98a64d0 - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] Hang in pldebugger after git commit : 98a64d0
Date
Msg-id CAA4eK1+cgTZSEF9THqbL+thbgi3PpjsowycB_km91LvCmEdK6w@mail.gmail.com
Whole thread Raw
In response to Hang in pldebugger after git commit : 98a64d0  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: [HACKERS] Hang in pldebugger after git commit : 98a64d0  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Dec 15, 2016 at 10:04 AM, Andres Freund <andres@anarazel.de> wrote:
> Hi,
>
> On 2016-12-12 16:46:38 +0900, Michael Paquier wrote:
>> Ashutosh, could you try it and see if it improves things?
>
> So what's the theory of why this triggers pldebugger hangs, but
> apparently causes not many other problems?
>

The theory is that with pldebugger latch event gets triggered before
FD_READ due to which it seems like the second event gets lost and
WaitForMultipleObjects() keeps on waiting indefinitely.  The probable
reason is that we fail to reset the event due to which we are seeing
this behavior. That seems to be required as per msdn as well, as
pointed by Robert upthread.

Find attached patch to implement the resetting of event only for the
required case.  This fixes the reported problem.

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: [HACKERS] Transaction oddity with list partition of a listpartition
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] Transaction oddity with list partition of a listpartition