Hung backends - Mailing list pgsql-hackers

From Schmidt, Peter
Subject Hung backends
Date
Msg-id F1DC8388AD52D411B83B00D0B774D6EB1927E6@winmail.prismedia.com
Whole thread Raw
List pgsql-hackers
<p><font face="Times New Roman">Hi,</font><br /><font face="Times New Roman">I'm new to PostgreSQL and have been asked
todetermine the cause of what appear to be hung processes on FreeBSD after one or more frontend apps crash. I did alot
ofsearching through the msg lists and found a few discussions that seem related, but I was unable to find a resolution
inthe msg archives. I noticed the last item in changes for PostgreSQL v7.0.3: </font><p><font face="Times New
Roman">Fixfor crash of backend, on abort (Tom) </font><br /><font face="Times New Roman">Is this related? Our scenario
is,a frontend java program creates multiple connections to PostgreSQL v7.0.2 attempting to exceed MAXBACKENDS. If the
programcrashes(unhandled exception) we're left with hung (or waiting processes) on FreeBSD equal to the number of
successfulconnections (ps log below). Subsequent connection attempts are eventually rejected (when MAXBACKENDS is
reached)with "Sorry, too many clients already". I've waited for over an hour to see if these processes get cleaned up,
butthey don't.</font><p><font face="Times New Roman">The only msgs I could dig up that seem like they _could_ be
relatedare a discussion between Dirk Niggemann and Tom Lane in Oct/1999 ("timeouts in libpq- can libpq requests block
forever/avery long time?" - PGTIMEOUT and PGCONNTIMEOUT) - I could be way off the mark on this one
though...</font><p><fontface="Times New Roman">Thanks for any and all advice.</font><br /><font face="Times New
Roman">PeterSchmidt</font><p><font face="Times New Roman">postgres@dev-postgres:~ > ps -cl -U postgres</font><br
/><fontface="Times New Roman">  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND</font><br
/><fontface="Times New Roman">  500  1395     1   0   2  0  4040 2380 select Ss    ??    0:01.17 postgres</font><br
/><fontface="Times New Roman">  500  2255  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2256  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2257  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2258  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2259  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2260  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2261  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2262  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2263  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2264  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2265  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2266  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2267  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2268  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2269  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2270  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2271  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2272  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2273  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2274  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2275  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2317  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2318  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2319  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2320  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2321  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2322  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2323  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2324  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2325  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2326  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500  2327  1395   0   2  0  4384 2984 sbwait I     ??    0:00.01 postgres</font><br
/><fontface="Times New Roman">  500   892   890   0  10  0  1636 1412 wait   S     p2    0:00.37 bash</font><br /><font
face="TimesNew Roman">  500   979   892   0  28  0  1672 1368 -      T     p2    0:00.02 psql</font><br /><font
face="TimesNew Roman">  500  2385   892   0  28  0   440  264 -      R+    p2    0:00.00 ps</font><br /><br /> 

pgsql-hackers by date:

Previous
From: "Carlos Jacobs"
Date:
Subject: Import text field
Next
From: "G. Anthony Reina"
Date:
Subject: Weird backup file