Re: [HACKERS] Instability in select_parallel regression test

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] Instability in select_parallel regression test
Дата
Msg-id CA+TgmoZifsRFwP2Aby6yL9sj+oxML53mAfccV-7CqTGvmiEVHQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Instability in select_parallel regression test  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sun, Feb 19, 2017 at 5:54 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> However, it looks like there's a race condition here, because the slot
> doesn't get freed up at the same time that the PID gets set to 0.
> That actually happens later, when the postmaster calls
> maybe_start_bgworker() or DetermineSleepTime() and one of those
> functions calls ForgetBackgroundWorker(). We could tighten this up by
> changing CleanupBackgroundWorker() to also call
> ForgetBackgroundWorker() immediately after calling
> ReportBackgroundWorker() if rw->rw_terminate ||
> rw->rw_worker.bgw_restart_time == BGW_NEVER_RESTART.  If we do that
> BEFORE sending the notification to the starting process, that closes
> this hole.  Almost.

And here's a patch implementing something along those lines.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

Вложения

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: [HACKERS] Provide list of subscriptions and publications inpsql's completion
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Provide list of subscriptions and publications inpsql's completion