Re: Simplify sleeping while reading/writing from client - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Simplify sleeping while reading/writing from client
Date
Msg-id CAB7nPqSy4ZAD1BA-RYyfQv1Faetyfx7SmNtgeS1=Q5jRSfhU+w@mail.gmail.com
Whole thread Raw
In response to Simplify sleeping while reading/writing from client  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Simplify sleeping while reading/writing from client  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On Thu, Feb 5, 2015 at 6:45 PM, Heikki Linnakangas wrote:
> Looking again at the code after Andres' interrupt-handling patch series, I
> got confused by the fact that there are several wait-retry loops in
> different layers, and reading and writing works slightly differently.
>
> I propose the attached, which pulls all the wait-retry logic up to
> secure_read() and secure_write(). This makes the code a lot more
> understandable.

Are you sure that it is a good idea to move the check of port->noblock
out of be_tls_[read|write] to an upper level? ISTM that we should set
errno and n to respectively EWOULDBLOCK and -1 in be_tls_[write|read]
when port->noblock and do nothing otherwise. In your patch those
values are set even if the port is in block mode.
-- 
Michael



pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: EvalPlanQual behaves oddly for FDW queries involving system columns
Next
From: Ashutosh Bapat
Date:
Subject: Re: ExplainModifyTarget doesn't work as expected