Re: A new function to wait for the backend exit after termination - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: A new function to wait for the backend exit after termination
Date
Msg-id CALj2ACUsy4HyX4qB3BuSrodoa93Zy2NVDL6Ki8OWgNGLgAT-8Q@mail.gmail.com
Whole thread Raw
In response to Re: A new function to wait for the backend exit after termination  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Thu, Oct 22, 2020 at 8:39 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
>> If the backend is terminated within the user specified timeout then
>> the function returns true, otherwise false.
>
> I’m suggesting an option for the second case to fail instead of returning false.
>

That seems fine.

>
>> >
>> > I could imagine, in theory at least, wanting to wait for a backend to go idle as well as for it disappearing.
Scopecreep in terms of this patch's goal but worth at least considering now. 
>> >
>>
>> IIUC, do we need a new option, something like pg_wait_backend(pid,
>> timeout, waituntil) where "waituntil" if specified "idle" waits until
>> the given backend goes to idle mode, or "termination" waits until
>> termination?
>>
>> If my understanding is wrong, could you please explain more?
>
>
> Yes, this describes what i was thinking.
>

+1.

I will implement these functionality and post a new patch soon.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: new heapcheck contrib module
Next
From: Greg Nancarrow
Date:
Subject: Re: Parallel INSERT (INTO ... SELECT ...)