libpq: Fix wrong connection status on invalid "connect_timeout"

From: Lars Kanis <lars(at)greiz-reinsdorf(dot)de>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: libpq: Fix wrong connection status on invalid "connect_timeout"
Date: 2019-10-17 18:04:19
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


libpq since PostgreSQL-12 has stricter checks for integer values in
connection parameters. They were introduced by commit

However in case of "connect_timeout" such an invalid integer value leads
to a connection status other than CONNECTION_OK or CONNECTION_BAD. The
wrong parameter is therefore not properly reported to user space. This
patch fixes this by explicit setting CONNECTION_BAD.

The issue was raised on ruby-pg:

It originally came up at Heroku:


Kind Regards,
Lars Kanis

Attachment Content-Type Size
0001-Fix-wrong-connection-status-on-invalid-connect_timeo.patch text/x-patch 1.1 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Lars Kanis 2019-10-17 20:10:17 Re: libpq: Fix wrong connection status on invalid "connect_timeout"
Previous Message Julien Rouhaud 2019-10-17 18:00:15 Non working timeout detection in logical worker