[pgpool-hackers: 1040] Re: Work around for child process hanging

Yugo Nagata nagata at sraoss.co.jp
Fri Sep 4 10:42:13 JST 2015


On Thu, 03 Sep 2015 14:13:49 +0900 (JST)
Tatsuo Ishii <ishii at postgresql.org> wrote:

> Sometimes we want to kill pgpool-II child for various reasons. For
> example, it goes into an infinite loop, it hopelessly wait for
> response from backend etc... Unfortunately currently there's no good
> way to kill such a process.
> 
> - If it is killed by SIGTERM, pgpool-II parent will not fork a new one
>   because it thinks that it is told being shutdown.
> 
> - If it is killed by SIGKILL, pgpool-II parent will fork a new one but
>   killing pgpool child using SIGKILL might cause unwanted side
>   effects.

What's the side effects? If these are critical and unavoidable, we should
add a notation about this to the documents.

> 
> Possible solutions would be:
> 
> - Check the number of child process in the health checking loop. If it
>   is less than num_init_children, for a new one.
> 
> - If parent notices that child pgpool-II is killed by SIGTERM, check
>   if it is told to shut down. If not, for a new one.
> 
> The latter looks smart but I'm not sure if it's possible.

I think it is possible to detect which SIGTERM is sent to, parent
(exit_handler() in pgpool_main.c) or child (die() in child.c). 
If this is sent to parent, pgpool is told to shut down.

Something wrong?

> 
> Comments?
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers


-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-hackers mailing list