Re: EINTR in ftruncate()

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: EINTR in ftruncate()
Дата
Msg-id CA+hUKGKx6Biq7_UuV0kn9DW+8QWcpJC1qwhizdtD9tN-fn0H0g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: EINTR in ftruncate()  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: EINTR in ftruncate()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: EINTR in ftruncate()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Jul 15, 2022 at 1:02 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Fri, Jul 15, 2022 at 12:15 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> > Yeah.  Done, and pushed.  0002 not back-patched.
>
> Hmm, there were a couple of hard to understand build farm failures.
> My first thought is that the signal mask stuff should only be done if
> IsUnderPostmaster, otherwise it clobbers the postmaster's signal mask
> when reached from dsm_postmaster_startup().  Looking into that.

I pushed that change, and I hope that clears up the problems seen on
eg curculio.  It does raise the more general question of why it's safe
to assume the signal mask is UnBlockSig on entry in regular backends.
I expect it to be in released branches, but things get more
complicated as we use DSM in more ways and it's not ideal to bet on
that staying true.  I checked that this throw-away assertion doesn't
fail currently:

        if (IsUnderPostmaster)
+       {
+               sigset_t old;
+               sigprocmask(SIG_SETMASK, NULL, &old);
+               Assert(memcmp(&old, &UnBlockSig, sizeof(UnBlockSig)) == 0);
                PG_SETMASK(&BlockSig);
+       }

... but now I'm wondering if we should be more defensive and possibly
even save/restore the mask.  Originally I discounted that because I
thought I had to go through PG_SETMASK for portability reasons, but on
closer inspection, I don't see any reason not to use sigprocmask
directly in Unix-only code.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Antonin Houska
Дата:
Сообщение: Re: Problem about postponing gathering partial paths for topmost scan/join rel
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: EINTR in ftruncate()