[pgpool-hackers: 3494] Re: [Proposal] Check if socket file exists at startup and remove them if PID file doesn't exist.
Bo Peng
pengbo at sraoss.co.jp
Thu Jan 23 11:44:50 JST 2020
Hello,
On Wed, 22 Jan 2020 12:01:02 +0900 (JST)
Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> >> The patch looks good to me. Also I think we should back patch this to
> >> all supported branches.
> >
> > Thank you for reviewing my patch.
> > Yes. I agree to back patch it to all supported branches.
>
> You are welcome.
>
> BTW, although not directly connected this patch, I found a bug with
> Pgpool-II start up process while checking the patch. Around line 279
> of main/main.c:
>
> if (pid > 0)
> {
> if (kill(pid, 0) == 0)
> {
> ereport(FATAL,
> (errmsg("pid file found. is another pgpool(%d) is running?\n", pid)));
> }
> else
> ereport(NOTICE,
> (errmsg("pid file found but it seems bogus. Trying to start pgpool anyway...\n")));
> }
>
> Since elog system is not yet initialized at this point, those messages
> are effectively ignored. Probably we should change them to standard
> fprintf(stderr...) or something like that.
Yes. ereport(...) doesn't output any messages.
But, when I change ereport(...) -> fprintf(stderr...),
if (pid > 0)
{
if (kill(pid, 0) == 0)
{
fprintf(stderr, "pid file found. is another pgpool(%d) is running?\n", pid);
}
else
{
fprintf(stderr, "pid file found but it seems bogus. Trying to start pgpool anyway...\n");
}
}
the messages are redirected to log file, instead of standard output.
Is it expected behavior?
----- pgpool.log -----
pid file found but it seems bogus. Trying to start pgpool anyway...
----------------------
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
--
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan
More information about the pgpool-hackers
mailing list