Re: Windows: Wrong error message at connection termination

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lars Kanis <lars(at)greiz-reinsdorf(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Windows: Wrong error message at connection termination
Date: 2021-11-17 22:01:37
Message-ID: 2779728.1637186497@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Lars Kanis <lars(at)greiz-reinsdorf(dot)de> writes:
> Explicit closing the socket before process termination leads to a
> graceful close even on Windows. That is done by the attached patch. I
> think delivering the correct error message to the user is much more
> important that closing the process in sync with the socket.

Per the comment immediately above this, it's intentional that we don't
close the socket. I'm not really convinced that this is an improvement.

Can we get anywhere by using shutdown(2) instead of close(), ie do a
half-close? I have no idea what Windows thinks the semantics of that
are, but it might be worth trying.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-11-17 22:26:57 Re: Windows: Wrong error message at connection termination
Previous Message Robert Haas 2021-11-17 22:01:36 xlog.c: removing ReadRecPtr and EndRecPtr