Hi Michael, Sawada-san and Horiguchi-san,

Thanks for the feedback. OK, let's go ahead to fix the perl module.

My besic idea is to 1) get OID of the backend then 2) do kill(0, $pid) to check
the existence. There were several approaches to get the backend PID to wait for,
I chose to remember the backend PID at wait_connect() and ensure its exit in 
quit().
This needs additional work for all background sessions but it looks simpler for 
me.
Another idea I came up with:

* Specify the backend PID by an argument. This can minimize changes on the 
module
  but developers must take care. It may be difficult to make it default.
* Obtain the backend PID in quit(). This must consider the case queries input
  before the quit() returns results asynchronously thus stdout/stderr can be
  mixture.

0001 implemented the idea and 0002 used it. 0003 patch made sure the waiting is 
done
by default. Per my quick check, 013_temp_obj_multisession tried to ensure
shmem_cleanup can be blocked, so quit(0) must be used here.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment: 0001-Allow-BackgroundPsql-quit-to-wait-for-backend-exit.patch
Description: 0001-Allow-BackgroundPsql-quit-to-wait-for-backend-exit.patch

Attachment: 0002-Use-BackgroundPsql-quit-1-to-wait-for.patch
Description: 0002-Use-BackgroundPsql-quit-1-to-wait-for.patch

Attachment: 0003-Wait-for-backend-exit-by-default-in-BackgroundPsql-q.patch
Description: 0003-Wait-for-backend-exit-by-default-in-BackgroundPsql-q.patch

Reply via email to