[odb-users] odb libpq connection debugging
MM
finjulhich at gmail.com
Wed Sep 25 13:40:46 EDT 2024
Hi,
Case 1: Process entirely C++. We create a ssh tunnel with the help of
libssh2 and obtain a dynamic local port that the tunnel listens on. ODB
postgres database class creation is pointed to this in-process tunnel
(localhost, localport) and the class is created ,and the db.begin() call
inside a transation succeeds and queries work and everything works.
Case 2: Process mixes python and C++. We exposed the creation of
odb::database via boost::python. From python we instantiate the
odb::database instance that we get back as a opaque pointer. We use
sshtunnel python module to create the tunnel
case 2.1 : python process1 runs the sshtunnel module
python process2 instantiate the ODB database class (via
boost::python) and runs queries to this sshtunnel process1 successfully all
the way to the database and queries work.
case 2.2: we tried in the *same* python process to do use the
sshtunnel module and instantiate the ODB database class and start the
odb::transaction.
As connection to postgresql is laze, the odb::transaction is what hangs. we
have a pg connection_timeout of 10second, and it times out.
We see however the odb/libpq local socket connected successfully to the
in-process sshtunnel listening port , ESTABLISHED successfully, so what
must be failing further comm through the tunnel to reach all the way to the
remote postgreql server.
We see the postgresql server side TCP connection never established.
Is there any way to tell odb to tell libpq to debug more?
Can the global python interpreter GIL lock impact this?
Rds,
MM
More information about the odb-users
mailing list