Re: on_exit_reset fails to clear DSM-related exit actions
От | Tom Lane |
---|---|
Тема | Re: on_exit_reset fails to clear DSM-related exit actions |
Дата | |
Msg-id | 20462.1394218482@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: on_exit_reset fails to clear DSM-related exit actions (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: on_exit_reset fails to clear DSM-related exit actions
Re: on_exit_reset fails to clear DSM-related exit actions |
Список | pgsql-hackers |
Robert Haas <robertmhaas@gmail.com> writes: > On Fri, Mar 7, 2014 at 10:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> I just noticed that the DSM patch has introduced a whole new class of >> failures related to the bug #9464 issue: to wit, any on_detach >> actions registered in a parent process will also be performed when a >> child process exits, because nothing has been added to on_exit_reset >> to prevent that. It seems likely that this is undesirable. > I don't think this can actually happen. There are quite a number of > things that would go belly-up if you tried to use dynamic shared > memory from the postmaster, which is why dsm_create() and dsm_attach() > both Assert(IsUnderPostmaster). Nonetheless it seems like a good idea to make on_exit_reset drop any such queued actions. The big picture here is that in the scenario being debated in the other thread, exit() in a child process forked from a backend will execute that backend's on_detach actions *even if the code had done on_exit_reset after the fork*. So whether or not you buy Andres' argument that it's not necessary for atexit_callback to defend against this scenario, there's actually no other defense possible given the way things work in HEAD. regards, tom lane
В списке pgsql-hackers по дате отправления: