[pgpool-hackers: 1831] Re: [pgpool-committers: 3532] patch of wd_lifecheck.c for stabilization

Tatsuo Ishii ishii at sraoss.co.jp
Tue Oct 4 14:07:19 JST 2016


Hi Mitani-san,

Doesn't Increasing wd_life_point from default help you?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

> Hi all,
> I created a patch file of wd_lifecheck.c for stabilizing.
> When I use pgpool-II 3.5.4 on the vm server,  life check often failed.
> Cause the vm server has fast clock CPU's and slow network periphelal.
> In this case the watchdog process had often failed to connect with other
> nodes.
> Therefore, I add sleep() instead of usleep() and retry routine in network
> connection.
> 
> In my case, the watchdog process was stabilized by this fix.
> I'd like to merge this patch when you confirm that there is no problem.
> 
> Regards,
> 
> --- src/watchdog/wd_lifecheck.c.org     2016-09-30 10:38:42.647168825 +0900
> +++ src/watchdog/wd_lifecheck.c 2016-09-30 10:51:06.402749336 +0900
> @@ -804,7 +804,7 @@ check_pgpool_status_by_query(void)
>                 rc = pthread_join(thread[i], (void **)&result);
>                 if ((rc != 0) && (errno == EINTR))
>                 {
> -                       usleep(100);
> +                       sleep(1);
>                         continue;
>                 }
> 
> @@ -953,11 +953,19 @@ wd_check_heartbeat(LifeCheckNode* node)
>  static int
>  wd_ping_pgpool(LifeCheckNode* node)
>  {
> -       PGconn * conn;
> +       PGconn * conn = NULL;
> +       int cnt = 0;
> 
> -       conn = create_conn(node->hostName, node->pgpoolPort);
> -       if (conn == NULL)
> -               return WD_NG;
> +       while (conn == NULL)
> +       {
> +               conn = create_conn(node->hostName, node->pgpoolPort);
> +               if ((conn == NULL) && (cnt > pool_config->wd_life_point))
> +               {
> +                       return WD_NG;
> +               }
> +               sleep(1);
> +               cnt ++;
> +       }
>         return ping_pgpool(conn);
>  }
> 
> --
> At.Mitani


More information about the pgpool-hackers mailing list