Regression in pipeline mode in libpq 14.5
От | Daniele Varrazzo |
---|---|
Тема | Regression in pipeline mode in libpq 14.5 |
Дата | |
Msg-id | CA+mi_8ZGSQNmW6-mk_iSR4JZB_LJ4ww3suOF+1vGNs3MrLsv4g@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Regression in pipeline mode in libpq 14.5
Re: Regression in pipeline mode in libpq 14.5 |
Список | pgsql-bugs |
Hello, I believe that pipeline mode was broken in libpq 14.5, likely after the refactoring performed to solve the problem of the unexpected Close messages sent on PQexecQuery [1]. The psycopg 3.1 test suite hangs when running with libpq 14.5 (reported at [2]). I have written a script to reproduce the issue, which can be executed running: ``` git clone -b fix-350 git@github.com:psycopg/psycopg.git cd psycopg python3 -m venv .venv source .venv/bin/activate pip install -e ./psycopg PSYCOPG_IMPL=debug python ./test-350.py ``` The script prints on stderr all the libpq calls and the be-fe trace. You can find attached the two logs obtained running the script with libpq 14.4 and 14.5. Differences can be seen online in [3]. The script runs, in Python: ``` with conn.cursor() as cur: with conn.pipeline() as p: cur.execute("SELECT 1") ``` The execute() runs an implicit BEGIN, which is also executed in pipeline mode. Exiting the pipeline() block causes a Sync. So we expect 3 results in the pipeline (a COMMAND_OK after BEGIN, a TUPLES_OK after SELECT, a PIPELINE_SYNC). At a glance I see the following behaviours in 14.5 which seem errors: - the result of the SELECT (TUPLES_OK) is lost. - later, a PQisBusy() returns 1, but the following epoll() call blocks and times out, nothing is received from the network. Happy to know if we need to do something different to accommodate changes in 14.5, however these seem regressions to me. Thank you very much -- Daniele [1] https://www.postgresql.org/message-id/CA%2Bmi_8bvD0_CW3sumgwPvWdNzXY32itoG_16tDYRu_1S2gV2iw%40mail.gmail.com [2] https://github.com/psycopg/psycopg/issues/350 [3] https://www.diffchecker.com/oe0yA6lu
Вложения
В списке pgsql-bugs по дате отправления: