Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'
Date: 2020-04-27 13:06:18
Message-ID: 20200427130618.GA24964@sh4-5.1blu.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El día Montag, April 27, 2020 a las 08:40:04 -0400, Tom Lane escribió:

> Matthias Apitz <guru(at)unixarea(dot)de> writes:
> > I encounter from time to time that one of our ESQL/C clients hangs with
> > the details described below for ever, while accessing on startup a table
> > 'sisisinst' which has only some 50 rows, all of CHAR columns. Other ESQL/C clients
> > start up fine (they all check this table 'sisisinst' on startup to
> > verify the correct version of our application) Also SQL works
> > fine.
>
> > What can I do to get to the source of the problem? Thanks
>
> Can you get a stack trace from the connected backend? Or even just look
> at what it's doing according to pg_stat_activity? (If it's a reasonably
> modern server, the wait-condition fields would be interesting.)

srap32dxr1:/opt/lib/sisis/catserver/bin # lsof -P | grep 53742
INDEX 23957 sisis 2u IPv6 117475261 0t0 TCP localhost:53742->localhost:5432 (ESTABLISHED)
postmaste 23958 postgres 9u IPv6 117478789 0t0 TCP localhost:5432->localhost:53742 (ESTABLISHED)

'INDEX' is the hanging proc; PID 23958 its server; gdb shows:

# gdb /usr/local/sisis-pap/pgsql/bin/postgres 23958
...
(gdb) bt
#0 0x00007fd567776000 in epoll_pwait () from /lib64/libc.so.6
#1 0x000000000084476c in WaitEventSetWaitBlock ()
#2 0x0000000000844647 in WaitEventSetWait ()
#3 0x00000000006f89d2 in secure_read ()
#4 0x0000000000707425 in pq_recvbuf ()
#5 0x0000000000707709 in pq_discardbytes ()
#6 0x0000000000707aba in pq_getmessage ()
#7 0x000000000086b478 in SocketBackend ()
#8 0x000000000086b4c4 in ReadCommand ()
#9 0x000000000086fda9 in PostgresMain ()
#10 0x00000000007dde15 in BackendRun ()
#11 0x00000000007dd595 in BackendStartup ()
#12 0x00000000007d9c9b in ServerLoop ()
#13 0x00000000007d9556 in PostmasterMain ()
#14 0x000000000070e2a5 in main ()

sisis=# select * from pg_stat_activity where client_port = 53742;

datid | datname | pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | xact_start | query_start | state_change | wait_event_type | wait_event | state | backend_xid | backend_xmin | query | backend_type

93831 | sisis | 23958 | 16384 | sisis | | ::1 | | 53742 | 27.04.2020 12:37:46.941441 CEST | | | 27.04.2020 12:37:46.943073 CEST | Client | ClientRead | idle | | | | client backend
(1 Zeile)

HIH && Kinde Regards

matthias

--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-04-27 13:13:11 Re: HOST variable in psql
Previous Message Paul Förster 2020-04-27 12:44:44 Re: HOST variable in psql