GSSENC'ed connection stalls while reconnection attempts.

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: GSSENC'ed connection stalls while reconnection attempts.
Date: 2020-07-10 08:38:03
Message-ID: 20200710.173803.435804731896516388.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Fix-reconnection-failure-of-GSSENC-connections.patch text/x-patch 2.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-07-10 09:01:58 Re: WIP: BRIN multi-range indexes
Previous Message torikoshia 2020-07-10 08:32:23 Re: Creating a function for exposing memory usage of backend process