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 1laiRn-0000r1-5m for pgsql-general@arkaria.postgresql.org; Sun, 25 Apr 2021 17:21:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1laiRm-00083D-2c for pgsql-general@arkaria.postgresql.org; Sun, 25 Apr 2021 17:21:30 +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 1laiRl-000834-RL for pgsql-general@lists.postgresql.org; Sun, 25 Apr 2021 17:21:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1laiRj-0008ON-1f for pgsql-general@lists.postgresql.org; Sun, 25 Apr 2021 17:21:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13PHLPqK2002578; Sun, 25 Apr 2021 13:21:25 -0400 From: Tom Lane To: Matthias Apitz cc: Laurenz Albe , pgsql-general@lists.postgresql.org Subject: Re: client waits for end of update operation and server proc is idle In-reply-to: References: <0551daad25ee518071e002ca17c4b6dac08a236c.camel@cybertec.at> <1935464.1619365905@sss.pgh.pa.us> Comments: In-reply-to Matthias Apitz message dated "Sun, 25 Apr 2021 18:05:27 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2002576.1619371285.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 25 Apr 2021 13:21:25 -0400 Message-ID: <2002577.1619371285@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthias Apitz writes: > El d=C3=ADa domingo, abril 25, 2021 a las 11:51:45a. m. -0400, Tom Lane = escribi=C3=B3: >> Hmph. So why wasn't this visible in the tcpdump trace? > It was visible. That's why I detected it while looking up the TCP > packages before the UPDATE: > 10:57:16.051326 IP 127.0.0.1.52288 > 127.0.0.1.5432: Flags [P.], seq 142= 80:14407, ack 120304, win 512, options [nop,nop,TS val 3424445708 ecr 3424= 445708], length 127 > 0x0000: 4500 00b3 b84e 4000 4006 83f4 7f00 0001 E....N@.@.....= .. > 0x0010: 7f00 0001 cc40 1538 d9b9 44bb fcd1 afb7 .....@.8..D...= .. > 0x0020: 8018 0200 fea7 0000 0101 080a cc1c e50c ..............= .. > 0x0030: cc1c e50c 5352 502d 3236 3937 363a 2072 ....SRP-26976:= .r > 0x0040: 6573 746f 7265 6420 7374 7275 6374 206b estored.struct= .k > 0x0050: 6574 7465 7361 747a 2066 6f72 2073 6574 ettesatz.for.s= et > 0x0060: 6964 3a32 2c20 6465 736b 3a33 3831 3832 id:2,.desk:381= 82 > 0x0070: 3038 302c 2066 656c 646e 723a 362c 206b 080,.feldnr:6,= .k > 0x0080: 6174 6b65 793a 3136 3839 3532 3937 392c atkey:16895297= 9, > 0x0090: 206b 6574 7465 7361 747a 2e66 7265 693a .kettesatz.fre= i: > 0x00a0: 302c 206b 6574 7465 7361 747a 2e61 6e7a 0,.kettesatz.a= nz > 0x00b0: 3235 0a 25. Ah. On looking at the server code, I see there *is* some validation on the message type code --- but here, the first byte is 'S' which happens to be a legal message type, so you got past that check. Still, the apparent message length is then "RP-2" (0x52502d32) which is bigger than 1GB so I don't quite understand why you didn't get an "out of memory" error. In any case, we could clearly do with some more sanity checking than is there now. I'll post a patch for that in a bit. regards, tom lane