Re: [HACKERS] postmaster disappears
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] postmaster disappears |
Дата | |
Msg-id | 21449.937922399@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | postmaster disappears (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Ответы |
Re: [HACKERS] postmaster disappears
|
Список | pgsql-hackers |
Tatsuo Ishii <t-ishii@sra.co.jp> writes: > In this case errno=ECHILD has been returned that makes postmaster > exiting. This could happen if SIGCHLD raised between select() call and > the next if (errno=...) statement. One of the solution would be > ignoring ECHILD as well as EINTR. Included are patches for this. Hmm. What you are saying, I guess, is that SIGCHLD is raised, reaper() executes, and then when control continues in the main loop the errno left over from reaper()'s last kernel call is what's seen, instead of the one returned by signal(). Seems to me that the correct fix is to have reaper() save and restore the outer value of errno, not to hack the main line to ignore the most probable state left over from reaper(). Otherwise you still choke if some other value gets returned from whatever call reaper() does last. Moreover, you're not actually checking what the select() did unless you do it that way. Curious that this sort of problem is not seen more often --- I wonder if most Unixes arrange to save/restore errno around a signal handler for you? regards, tom lane
В списке pgsql-hackers по дате отправления: