============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : Malcolm Beattie
Your email address : mbeattie@sable.ox.ac.uk
Category : runtime: back-end
Severity : non-critical
Summary: Hanging ident lookups stall whole backend
System Configuration
- --------------------
Operating System : Red Hat Linux 5.1, kernel 2.0.35
PostgreSQL version : 6.3.2
Compiler used : gcc
Hardware:
- ---------
Pentium II 300 MHz, 512MB RAM
Versions of other tools:
- ------------------------
- --------------------------------------------------------------------------
Problem Description:
- --------------------
When PostgreSQL is configured to use ident authentication,
the postmaster itself makes a synchronous connection to the
remote identd. If that identd doesn't respond (for example,
the default inetd limit of 40 connections per minute is
exceeded) then the postmaster hangs. Since the connection is
done synchronously with no explicit timeout, no further
client connections are serviced and postmaster hangs.
- --------------------------------------------------------------------------
Test Case:
- ----------
Set up PostgreSQL to use ident authentication. Set up the
client system with a ident daemon which hangs (either by
making enough connections for identd to disable the port or
perhaps by making a fakeidentd shell script which just does
"sleep 9999"). Make a connection from the client and watch
the postmaster hang and not accept any other connections from
anywhere.
- --------------------------------------------------------------------------
Solution:
- ---------
Fix the ident() function in backend/libpq/hba.c so that it
has a timeout (or if you want to get fancy, do the lookup
asynchronously in another thread or process). No patch
today, sorry.
- --------------------------------------------------------------------------