Fujii Masao <masao.fu...@gmail.com> writes:
>> +               * XXX: Is it safe to elog(ERROR) in a signal handler?
>> 
>> No, it isn't.

> We should use elog(FATAL) or check proc_exit_inprogress, instead?

elog(FATAL) is *certainly* not a better idea.  I think there's really
nothing that can be done, you just have to silently ignore the error.
BTW, if we retry, there had probably better be a limit on how many times
to retry ...

> +             if (errno != EAGAIN && errno != EWOULDBLOCK)
> +             {
> +                     /*
> +                      * XXX: Is it safe to elog(ERROR) in a signal handler?
> +                      */
> +                     elog(ERROR, "write() on self-pipe failed: %m");
> +             }
> +             if (errno == EINTR)
> +                     goto retry;

> "errno == EINTR)" seems to be never checked.

Another issue with coding like that is that it supposes elog() won't
change errno.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to