Pgpool-II version
4.8devel (1a873669), backend_clustering_mode = raw, connection_cache = on, one configured PostgreSQL node.
Description
A query that changes two reportable session parameters, followed by another extended-protocol query in the same pipeline segment, succeeds on direct PostgreSQL but closes the Pgpool frontend.
Before waiting for the next client query, PostgreSQL reports each changed GUC_REPORT variable as a backend ParameterStatus message (guc.c, application_name, DateStyle). When handling the next Parse while the backend is idle, Pgpool sends an internal Sync, consumes at most one ParameterStatus, and then requires ReadyForQuery (pool_proto_modules.c). The second message triggers invalid read kind "S" and closes the frontend.
Reproduce
Start PostgreSQL 16 and Pgpool-II in the configuration above, install psycopg, and run:
import psycopg
def run(label, dsn):
conn = psycopg.connect(dsn, autocommit=True)
try:
with conn.pipeline():
conn.execute(
"SELECT set_config(%s, %s, false), "
"set_config(%s, %s, false)",
("application_name", "business", "DateStyle", "ISO, DMY"),
)
result = conn.execute("SELECT 99")
print(f"{label}: {result.fetchone()[0]}")
except Exception as exc:
print(f"{label}: {type(exc).__name__}: {str(exc).splitlines()[0]}; closed={conn.closed}")
finally:
conn.close()
run("direct", DIRECT_DSN)
run("pgpool", PGPOOL_DSN)
Expected behavior
Both endpoints should complete the pipeline, remain usable, and print:
Actual behavior
The reproducer prints:
direct: 99
pgpool: OperationalError: consuming input failed: server closed the connection unexpectedly; closed=True
Pgpool-II version
4.8devel(1a873669),backend_clustering_mode = raw,connection_cache = on, one configured PostgreSQL node.Description
A query that changes two reportable session parameters, followed by another extended-protocol query in the same pipeline segment, succeeds on direct PostgreSQL but closes the Pgpool frontend.
Before waiting for the next client query, PostgreSQL reports each changed
GUC_REPORTvariable as a backendParameterStatusmessage (guc.c,application_name,DateStyle). When handling the nextParsewhile the backend is idle, Pgpool sends an internalSync, consumes at most oneParameterStatus, and then requiresReadyForQuery(pool_proto_modules.c). The second message triggersinvalid read kind "S"and closes the frontend.Reproduce
Start PostgreSQL 16 and Pgpool-II in the configuration above, install
psycopg, and run:Expected behavior
Both endpoints should complete the pipeline, remain usable, and print:
Actual behavior
The reproducer prints: