Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOaFT-007LDe-O0 for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 10:28:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tOaFS-009Fwo-R6 for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 10:28:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOXtf-006wEP-UJ for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 07:58:07 +0000 Received: from zproxy4.mail3d.it ([212.78.3.137]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOXtb-000WAD-Jg for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 07:58:05 +0000 Received: from zproxy4.mail3d.it (localhost.localdomain [127.0.0.1]) by zproxy4.mail3d.it (Postfix) with ESMTPS id 9E473608AF; Fri, 20 Dec 2024 08:58:00 +0100 (CET) Received: from localhost (localhost.localdomain [127.0.0.1]) by zproxy4.mail3d.it (Postfix) with ESMTP id 82E41608BB; Fri, 20 Dec 2024 08:58:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zproxy4.mail3d.it 82E41608BB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cleistech.it; s=1D99BE42-E8ED-11ED-9278-A8004466375A; t=1734681480; bh=38VU9O3sU9ty9L9W5zq7esfWlqdwkfmCrfvALaE0E1Q=; h=Message-ID:Date:MIME-Version:From:To; b=ehyLtM4OfATE6JF6CbnVd6Sk2cwzFkjy6MLsy1nyI/DKG//DLL0uaUIRJoQSlEh0T fiQdwndERlbXbXioAhB0wguHZRp/VavAQnk7VNFSHr7NkZ0rrIBu8L64OBQJrb76cE S2Eh+BsCQc/8XF6T/psJtGm0Mq8btCmYVMrP3l6k6GHsG679H83Xio1kAhpIOr2fvh eO2fvxh4g0y7Ke3wkEz+ablL1wr7Xs32Dmd21yTe6J0uXkDW0MRZtFgZh2Q96iimvt 7wLakO/mpDPw8WlAhv3P/bc7Kcc0DZMDhEriDFeXvs/OuUcRIAwAhQUBQkJc3cmapM zrhW4YZ1HtyWA== Received: from zproxy4.mail3d.it ([127.0.0.1]) by localhost (zproxy4.mail3d.it [127.0.0.1]) (amavis, port 10026) with ESMTP id 6pSzLIRc_8OE; Fri, 20 Dec 2024 08:58:00 +0100 (CET) Received: from [192.168.254.110] (unknown [151.93.5.250]) by zproxy4.mail3d.it (Postfix) with ESMTPSA id 3BB07608AF; Fri, 20 Dec 2024 08:58:00 +0100 (CET) Content-Type: multipart/alternative; boundary="------------l8nyFDgLzWebjZuqitJ0uS89" Message-ID: <649fadb9-eb67-4b11-beb8-49ff857b355b@cleistech.it> Date: Fri, 20 Dec 2024 08:57:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Enrico Schenone Subject: Re: Intermittent errors when fetching cursor rows on PostgreSQL 16 To: Adrian Klaver , pgsql-general@lists.postgresql.org Cc: Massimo Catti , Livio Pizzolo References: <446423eb-4a4e-4135-bbb8-4d0e5c7aac3b@cleistech.it> <25d5fb16-9bb2-4ad1-969c-eaca03ccbaaf@aklaver.com> <6ce80aaa-970b-4432-938a-39a07f811599@cleistech.it> <9f60eb26-7d34-4228-bd78-74c6deb90e54@aklaver.com> <282c2a48-bb12-4486-b03d-563523cac81b@cleistech.it> <2645a89e-d661-4f2b-92b3-01154a78d535@aklaver.com> <54689a6a-839c-44c4-90b5-b9692e8e7cb0@aklaver.com> Content-Language: it In-Reply-To: <54689a6a-839c-44c4-90b5-b9692e8e7cb0@aklaver.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------l8nyFDgLzWebjZuqitJ0uS89 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable At 19/12/24 22:47, Adrian Klaver wrote: > > > On 12/19/24 11:40 AM, Enrico Schenone wrote: >> Hello, my answers in line along your message ... >> Thanks a lot again. >> >> Enrico >> > >>> On 12/19/24 10:11, Enrico Schenone wrote: >>>> Good day, Adrian. >>>> I get the error inside the program by catching the exception and=20 >>>> logging it with diagnostic info provided by the DVM (a runtime=20 >>>> interpreter similar in concept to a JVM) that embed the PG driver. >>> > >> The 4Js DVM (Dynamic Virtual Machine) is that one=20 >> https://4js.com/online_documentation/fjs-gas-manual-html/index.html#ga= s-topics/c_gas_what_is_dvm.html >> >>> In other words an Android client? >>> >> No, it is a runtime interpreter for Linux, Windows, IBM AIX, macOS=20 >> and other unix-like OSs. It ensures the portability of 4Js Genero=20 >> compiled programs (p-code) on several OS platforms. >> 4Js Genero is a Low Code Application Platform. The programming=20 >> language, named "BDL - Business Development Language", is an=20 >> evolution of the Informix-4gl. >> Compiled programs needs a runtime interpreter (DVM) to be executed. >> The DVM embeds at low-level the DB drivers provided by several vendors= , > > From previous post you mentioned: > > "Four Js support said =C2=A0vendor. In the case of PostgreSQL, we use the C API client " > > So are they building their own driver over libpq? I think so. They wrote ... < /The error =E2=80=9Cno connection to the server=E2=80=9C is definitively = a PostgreSQL=20 error:/ /||/ /|./src/interfaces/libpq/fe-exec.c: libpq_append_conn_error(conn, "no=20 connection to the server");|/ /It is not normal that PostgreSQL client can connect to the server, do=20 some SQL with success and then the SQL connection gets dropped at the=20 next SQL statement execution. This is really suspicious./ > > >> and at BDL high level the application program can easily connect to=20 >> the major DBs on the market thanks to its ODI (Open Database Interface= ). >>>> I can't give you info on what the DVM does at low level, but I can=20 >>>> send you the distinct full session log fragment at server side,=20 >>>> where it is quite easy to understand how the DVM translates the=20 >>>> program's SQL queries end what PostgreSQL does. >>> >>> That might be useful. >>> >> Please take a look to the attached text file, that is the full=20 >> failing session log (filtered from the debug5 PostgreSQL server log). > > This is where it falls off the rails, but I can't see why?: > > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 LOCATION: ShowTransactionStateRec,=20 > xact.c:5510 > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 STATEMENT:=C2=A0 fetch forward 50 fr= om cu6 > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 LOG:=C2=A0 00000: statement: fetch=20 > forward 50 from cu6 > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 LOCATION:=C2=A0 exec_simple_query,=20 > postgres.c:1073 > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 DEBUG:=C2=A0 00000: CommitTransactio= n(1)=20 > name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid:=20 > 0/1/0 > > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 LOCATION: ShowTransactionStateRec,=20 > xact.c:5510 > 2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17900000676054e0.21cb42 STATEMENT:=C2=A0 fetch forward 50 fr= om cu6 > 2024-12-16 17:27:14.407 CET [2214722] cleistech@hh24odds_prod -=20 > 192.168.16.17908006676054e0.21cb42 LOG:=C2=A0 08006: could not receive = data=20 > from client: Connessione interrotta dal corrispondente > Yes, at 2024-12-16 17:27:14.407 This seems to match exactly with the error XX001 reported by the client=20 application. >>>> Thanks again and best regards. >>>> Enrico > > Best regards. Enrico --------------l8nyFDgLzWebjZuqitJ0uS89 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable At 19/12/24 22:47, Adrian Klaver wrote:


On 12/19/24 11:40 AM, Enrico Schenone wrote:
Hello, my answers in line along your message ...
Thanks a lot again.

Enrico


On 12/19/24 10:11, Enrico Schenone wrote:
Good day, Adrian.
I get the error inside the program by catching the exception and logging it with diagnostic info provided by the DVM (a runtime interpreter similar in concept to a JVM) that embed the PG driver.


The 4Js DVM (Dynamic Virtual Machine) is that one = https://4js.com/online_documentation/fjs-gas-manual-html/index.html#gas-t= opics/c_gas_what_is_dvm.html

In other words an Android client?

No, it is a runtime interpreter for Linux, Windows, IBM AIX, macOS and other unix-like OSs. It ensures the portability of 4Js Genero compiled programs (p-code) on several OS platforms.
4Js Genero is a Low Code Application Platform. The programming language, named "BDL - Business Development Language", is an evolution of the Informix-4gl.
Compiled programs needs a runtime interpreter (DVM) to be executed.
The DVM embeds at low-level the DB drivers provided by several vendors,

From previous post you mentioned:

"Four Js support said <We use the standard C API provided by the DB
=C2=A0vendor. In the case of PostgreSQL, we use the C API client "

So are they building their own driver over libpq?
I think so.
They wrote ...
<

The error =E2=80=9Cno connection to the server=E2=80=9C is defi= nitively a PostgreSQL error:

<= /i>
./src= /interfaces/libpq/fe-exec.c: libpq_append_conn_error(conn, "no connection= to the server");

It = is not normal that PostgreSQL client can connect to the server, do some SQL with success and then the SQL connection gets dropped at the next SQL statement execution. This is really suspicious.

>


and at BDL high level the application program can easily connect to the major DBs on the market thanks to its ODI (Open Database Interface).
I can't give you info on what the DVM does at low level, but I can send you the distinct full session log fragment at server side, where it is quite easy to understand how the DVM translates the program's SQL queries end what PostgreSQL does.

That might be useful.

Please take a look to the attached text file, that is the full failing session log (filtered from the debug5 PostgreSQL server log).

This is where it falls off the rails, but I can't see why?:

2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 LOCATION:=C2=A0 ShowTransactionStateRec, xact.c:5510
2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 STATEMENT:=C2=A0 fetch forward 5= 0 from cu6
2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 LOG:=C2=A0 00000: statement: fet= ch forward 50 from cu6
2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 LOCATION:=C2=A0 exec_simple_quer= y, postgres.c:1073
2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 DEBUG:=C2=A0 00000: CommitTransaction(1) name: unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0

2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 LOCATION:=C2=A0 ShowTransactionStateRec, xact.c:5510
2024-12-16 17:27:14.406 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17900000676054e0.21cb42 STATEMENT:=C2=A0 fetch forward 5= 0 from cu6
2024-12-16 17:27:14.407 CET [2214722] cleistech@hh24odds_prod - 192.168.16.17908006676054e0.21cb42 LOG:=C2=A0 08006: could not rece= ive data from client: Connessione interrotta dal corrispondente

Yes, at 2024-12-16 17:27:14.407
This seems to match exactly with the error XX001 reported by the client application.

Thanks again and best regards.
Enrico


Best regards.
Enrico
--------------l8nyFDgLzWebjZuqitJ0uS89--