BUG #4602: child processes inherit database socket

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема BUG #4602: child processes inherit database socket
Дата
Msg-id 200901060956.n069uYVX036518@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4602: child processes inherit database socket  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4602
Logged by:          Jasen Betts
Email address:      jasen@treshna.com
PostgreSQL version: 8.3
Operating system:   linux
Description:        child processes inherit database socket
Details:

libpq creates sockets to the server without CLOEXEC.

as a result child processes inherit instances of the database socket

this wastes resources, and in some cases seems to keep the backend around
after the client has expired.

unless there's a reaon why duplicating the sockets is useful it can be
stopped like this:

  {
  int dflags =  fcntl( socket_fd, F_GETFD );
  fcntl( socket_fd, F_SETFD , dflags | CLOEXEC );
  }

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

Предыдущее
От: "V KUMAR"
Дата:
Сообщение: BUG #4601: Data saving and opening problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4602: child processes inherit database socket