Re: Windows socket problems, interesting connection to AIO - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Windows socket problems, interesting connection to AIO
Date
Msg-id 20240910224052.7a.nmisch@google.com
Whole thread Raw
In response to Windows socket problems, interesting connection to AIO  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
On Mon, Sep 02, 2024 at 09:20:21PM +1200, Thomas Munro wrote:
> 2.  If a Windows client tries to send() and gets an ECONNRESET/EPIPE
> error, then the network stack seems to drop already received data, so
> a following recv() will never see it.  In other words, it depends on
> whether the application-level protocol is strictly request/response
> based, or has sequence points at which both ends might send().  AFAIK
> the main consequence for real users is that FATAL recovery conflict,
> idle termination, etc messages are not delivered to clients, leaving
> just "server closed the connection unexpectedly".

> The new thought I had about the second category of problem is: if you
> use asynchronous networking APIs, then the kernel *can't* throw your
> data out, because it doesn't even have it.  If the server's FATAL
> message arrives before the client calls send(), then the data is
> already written to user space memory and the I/O is marked as
> complete.

Good point.

> just wanted to share this observation.

Thanks for sharing that and the test program.



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Use read streams in pg_visibility
Next
From: Andy Fan
Date:
Subject: Re: Make printtup a bit faster