Re: Simplify backend terminate and wait logic in postgres_fdw test - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Simplify backend terminate and wait logic in postgres_fdw test
Date
Msg-id YG+dcIJrFKHUw03L@paquier.xyz
Whole thread Raw
In response to Re: Simplify backend terminate and wait logic in postgres_fdw test  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Simplify backend terminate and wait logic in postgres_fdw test
List pgsql-hackers
On Thu, Apr 08, 2021 at 06:27:56PM +0530, Bharath Rupireddy wrote:
> Agree. Please see the attached patch, I removed a fixed waiting time.
> Instead of relying on pg_stat_activity, pg_sleep and
> pg_stat_clear_snapshot, now it depends on pg_terminate_backend and
> pg_wait_for_backend_termination. This way we could reduce the
> functions that the procedure terminate_backend_and_wait uses and also
> the new functions pg_terminate_backend and
> pg_wait_for_backend_termination gets a test coverage.

+       EXIT WHEN is_terminated;
+       SELECT * INTO is_terminated FROM pg_wait_for_backend_termination(pid_v, 1000);
This is still a regression if the termination takes more than 1s,
no?  In such a case terminate_backend_and_wait() would issue a WARNING
and pollute the regression test output.  I can see the point of what
you are achieving here, and that's a good idea, but from the point of
view of the buildfarm the WARNING introduced by aaf0432 is a no-go.  I
honestly don't quite get the benefit in issuing a WARNING in this case
anyway, as the code already returns false on timeout so as caller
would know the status of the operation.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Lots of incorrect comments in nodeFuncs.c
Next
From: "Euler Taveira"
Date:
Subject: Re: missing documentation for streaming in-progress transactions