Re: "Idle in Transaction" and hung connections

Поиск
Список
Период
Сортировка
От Gregory S. Williamson
Тема Re: "Idle in Transaction" and hung connections
Дата
Msg-id 71E37EF6B7DCC1499CEA0316A256832801057918@loki.wc.globexplorer.net
обсуждение исходный текст
Ответ на "Idle in Transaction" and hung connections  ("Gregory S. Williamson" <gsw@globexplorer.com>)
Ответы Re: "Idle in Transaction" and hung connections  (Kris Jurka <books@ejurka.com>)
Список pgsql-general
Tom --

Thanks for the suggestion, and the rapid response on something which may not be truely a postgres issue (perhaps more a
JDBCthing)! 

I'll make sure to try this next time we see this oddness in action. May be hours, may be days...

Greg

-----Original Message-----
From:    Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent:    Thu 4/29/2004 3:03 PM
To:    Gregory S. Williamson
Cc:    pgsql-general@postgresql.org
Subject:    Re: [GENERAL] "Idle in Transaction" and hung connections
"Gregory S. Williamson" <gsw@globexplorer.com> writes:
> Very occasionally we will see a thread go wild, taking up a huge
> amount of processor time (the load will climb by "1" for each process
> -- usual load is around .2, when these hit the load rises to 1.x all
> the way up to a load of about 40 once). The pg_stat_activity shows
> these conections as being old -- much older than any live thread. All
> such connections are in a state of "IDLE IN TRANSACTION" which seems
> odd

This is not unexpected due to the way JDBC (mis)uses BEGIN/COMMIT.
However it is strange that such a connection would start using
a significant amount of CPU time.  It should be waiting for a new
client query.

> Does anyone have any ideas what might be triggering this ?

No.  Try attaching to a looping backend with gdb so you can get a stack
trace.  I would suggest something along the lines of

    gdb /path/to/postgres PID
    bt
    cont
    ... wait a few seconds, press control-C, and again do:
    bt
    cont
    ... lather, rinse, repeat a few times, then control-C and:
    quit

Comparison of four or five stack traces obtained this way should make it
fairly clear where the loop is, and then we can determine whether we
need more info to solve it.

            regards, tom lane




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

Предыдущее
От: "Karl O. Pinc"
Дата:
Сообщение: Plpgsql problem passing ROWTYPE to function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "Idle in Transaction" and hung connections