Skip site navigation (1) Skip section navigation (2)

Re: [patch] helps fe-connect.c handle -EINTR more gracefully

From: David Ford <david(at)blue-labs(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Date: 2001-10-26 19:37:05
Message-ID: 3BD9BB61.60302@blue-labs.org (view raw or flat)
Thread:
Lists: pgsql-hackers
>
>
>After further thought, though, it's unclear to me why this solves
>David's problem.  If he's got a repeating SIGALRM on a cycle short
>enough to interrupt a connect(), seems like it'd just fail again
>on the next try.
>

Ok, a few things.  The connect() call is just an interface to the 
kernel.  Sometimes a connect() to a socket may take a long time, even up 
to two minutes (or depending on your kernel's timeout), so it isn't 
unfeasible that the call can be interrupted.  Next, the userland 
connect() is interrupted but the kernel isn't.  The kernel keeps working 
it and eventually completes or aborts the connection attempt.  It then 
sets the data structures and values so the next time userland comes 
alive it's ready for it.  The connect() call doesn't restart at the 
beginning, it continues where it left off.

David



pgsql-hackers by date

Next:From: David FordDate: 2001-10-26 19:57:01
Subject: Re: [patch] helps fe-connect.c handle -EINTR more gracefully
Previous:From: Peter EisentrautDate: 2001-10-26 18:41:16
Subject: Re: 7.2b1 ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group