Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jT3Ss-0007vC-V5 for pgsql-general@arkaria.postgresql.org; Mon, 27 Apr 2020 13:06:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jT3Sr-0001ks-Py for pgsql-general@arkaria.postgresql.org; Mon, 27 Apr 2020 13:06:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jT3Sr-0001kj-IL for pgsql-general@lists.postgresql.org; Mon, 27 Apr 2020 13:06:25 +0000 Received: from smh-06.1blu.de ([178.254.0.206]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jT3So-00013F-IJ for pgsql-general@lists.postgresql.org; Mon, 27 Apr 2020 13:06:24 +0000 Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1jT3Sk-0008UP-Ln; Mon, 27 Apr 2020 15:06:18 +0200 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.90_1) (envelope-from ) id 1jT3Sk-0000HW-KG; Mon, 27 Apr 2020 15:06:18 +0200 Date: Mon, 27 Apr 2020 15:06:18 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;' Message-ID: <20200427130618.GA24964@sh4-5.1blu.de> Reply-To: Matthias Apitz References: <20200427122123.GA11416@sh4-5.1blu.de> <5198.1587991204@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5198.1587991204@sss.pgh.pa.us> X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk El día Montag, April 27, 2020 a las 08:40:04 -0400, Tom Lane escribió: > Matthias Apitz 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@unixarea.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!