Re: EINTR error in SunOS - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: EINTR error in SunOS
Date
Msg-id 20060102185831.GB20219@svana.org
Whole thread Raw
In response to Re: EINTR error in SunOS  (Doug Royer <Doug@Royer.com>)
Responses Re: EINTR error in SunOS  (Doug McNaught <doug@mcnaught.org>)
Re: EINTR error in SunOS  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
On Mon, Jan 02, 2006 at 08:55:47AM -0700, Doug Royer wrote:
>
>
> Doug McNaught wrote:
>
> >c) treat EINTR as an I/O error (I don't know how easy this would be)
>
> So then at this point - it is detected, so problem solved?
>
> If a LOCAL hard drive fails to reply, you hang. Same with hard,intr
> NFS file system.

Not really. If a local hard drive fails to respond, the kernel times
out the request and returns EIO to the app. That's the most annoying
thing about NFS. At least even with reading bad floppies where the
kernel keeps retrying, eventually the read() returns and you can
cancel. With NFS, it never returns if the server never comes back.

The kernel is trying to be helpful by returning EINTR to say "ok, it
didn't complete. There's no error yet but it may yet work". With local
hard drives if they don't respond, you assume they're broken. When NFS
servers don't respond you assume someone has temporarily pulled a
cable and it will come back soon. Huh?

I would vote for the kernel, if the server didn't respond within 5
seconds, to simply return EIO. At least we know how to handle that...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Jon Jensen
Date:
Subject: Re: Why don't we allow DNS names in pg_hba.conf?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: What bison versions are installed on buildfarm machines?