Обсуждение: pgsql: Improve postmaster's behavior if an accept() call fails.

Поиск
Список
Период
Сортировка

pgsql: Improve postmaster's behavior if an accept() call fails.

От
tgl@postgresql.org (Tom Lane)
Дата:
Log Message:
-----------
Improve postmaster's behavior if an accept() call fails.  Because the server
socket is still read-ready, the code was a tight loop, wasting lots of CPU.
We can't do anything to clear the failure, other than wait, but we should give
other processes more chance to finish and release FDs; so insert a small sleep.
Also, avoid bogus "close(-1)" in this case.  Per report from Jim Nasby.

Modified Files:
--------------
    pgsql/src/backend/libpq:
        pqcomm.c (r1.189 -> r1.190)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/pqcomm.c.diff?r1=1.189&r2=1.190)
    pgsql/src/backend/postmaster:
        postmaster.c (r1.520 -> r1.521)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c.diff?r1=1.520&r2=1.521)