| От | Tom Lane |
|---|---|
| Тема | Re: Using connection after fork |
| Дата | |
| Msg-id | 29320.1092156685@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Using connection after fork (Jeff <threshar@torgo.978.org>) |
| Список | pgsql-general |
Jeff <threshar@torgo.978.org> writes:
> I've been bit by this sort of thing before. When you fork() the child
> inherits all the file descriptors , including the one connected to PG.
> But when the child dies that FD will be closed, thus it will also be
> closed in the parent causing "odd behavior". (At least, that is what
> I've seen in my apps)
That would only happen if the child explicitly does PQfinish() before
exiting, so that the backend sees an 'X' (Terminate) command arrive
and therefore cuts the connection from its end.
If the child just exits the pipe or TCP connection will remain open.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера