GSSENC'ed connection stalls while reconnection attempts.
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2020-07-10T08:38:03Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-reconnection-failure-of-GSSENC-connections.patch (text/x-patch)
Hello. If psql connected using GSSAPI auth and server restarted, reconnection sequence stalls and won't return. I found that psql(libpq) sends startup packet via gss encryption. conn->gssenc should be reset when encryption state is freed. The reason that psql doesn't notice the error is pqPacketSend returns STATUS_OK when write error occurred. That behavior contradicts to the comment of the function. The function is used only while making connection so it's ok to error out immediately by write failure. I think other usage of pqFlush while making a connection should report write failure the same way. Finally, It's user-friendly if psql shows error message for error on reset attempts. (This perhaps should be arguable.) The attached does the above. Any thoughts and/or opinions are welcome. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Fix bugs in libpq's management of GSS encryption state.
- 8e6f134a9a8d 13.0 landed
- 25fe5ac45a73 14.0 landed
- e8b22a8a2b65 12.4 landed