help debugging hung process - Mailing list pgsql-general

From webmaster@iarms.com
Subject help debugging hung process
Date
Msg-id 445D1BDD.9000200@iarms.com
Whole thread Raw
Responses Re: help debugging hung process  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm having problems with hanging apache processes that seem
to be stuck in pqSocketPoll.

I'm running postgresql 7.4.11 on CentOS 3 (upgraded from
7.4.5 that was also having this problem; haven't upgraded
to 7.4.12 because I haven't found RPMs yet). Using Apache
1.3.35 with mod_perl.

I haven't been able to reproduce the problem, but it's happening
at least a few times a day in production. Here's a backtrace of a
hung apache process:

#0  0x00f28919 in poll () from /lib/tls/libc.so.6
#1  0x0016d1cf in pqSocketPoll (sock=-4, forRead=-1, forWrite=1,
end_time=-1)
     at fe-misc.c:1040
#2  0x0016d08a in pqSocketCheck (conn=0x998cf18, forRead=1, forWrite=0,
     end_time=-1) at fe-misc.c:982
#3  0x0016cf77 in pqWaitTimed (forRead=-4, forWrite=-4, conn=0x998cf18,
     finish_time=-4) at fe-misc.c:914
#4  0x0016cf35 in pqWait (forRead=-4, forWrite=-4, conn=0xfffffffc)
     at fe-misc.c:897
#5  0x0016a9a9 in PQgetResult (conn=0x998cf18) at fe-exec.c:1074
#6  0x0016acbc in PQexecFinish (conn=0x998cf18) at fe-exec.c:1307
#7  0x001a885b in dbd_st_execute (sth=0x9e20ccc, imp_sth=0x9e337c0)
     at dbdimp.c:2135
#8  0x00199d29 in XS_DBD__Pg__st_execute (my_perl=0x8b0fca0, cv=0x982279c)
     at Pg.xsi:562
#9  0x0012295c in XS_DBI_dispatch (my_perl=0x8b0fca0, cv=0x857c6ac)
     at DBI.xs:2812
#10 0x002910d5 in Perl_pp_entersub (my_perl=0x8b0fca0) at pp_hot.c:2781

So I see it's stuck polling, but I don't know how to figure out what
the actual query/operation is that it's wait for. Any suggestions on
what I should try next?

Thank you.

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: intarray internals
Next
From: HH
Date:
Subject: Can't Figure Out Where Rows Are Going