|
|||||||||||
|
Re: non-blocking connect and EAGAIN
From: Chad MILLER <cmiller(at)mysql.com>
Date: Wed Sep 19 2007 - 10:04:53 EDT
On 19 Sep 2007, at 07:40, Vladimir Shebordaev wrote: > Hi, Dmitriy, Vladimir's right here. The Linux kernel doesn't normally send errno EINPROGRESS, but it does send EAGAIN for this case:
if (skb_queue_len(&other->sk_receive_queue) >
other->sk_max_ack_backlog) {
err = -EAGAIN;
if (!timeo)
goto out_unlock;
timeo = unix_wait_for_peer(other, timeo);
err = sock_intr_errno(timeo);
if (signal_pending(current))
goto out;
sock_put(other);
goto restart;
}
Notably, the BSDs don't send EAGAIN, as far as I can tell. > Otherwise connect() will block until there is some room available Agreed, for the most part. (I don't know that the kernel sends EAGAIN /only/ for no-timeout/non-blocking connect()ion attempts. I didn't dig wider than the above.) The Linux kernel truly couldn't accept the connect() syscall, and this is a valid problem. The library code behaves correctly because the library /should/ pass errors from the kernel up to the client. This specific case isn't one I think we considered, but client code should handle all errors the OS could generate; the library shouldn't insulate the client from the kernel, but it should from the server. > Please check out the MySQL 5.0 trouble shooting page at <http:// It could be a crashed server that's causing the problem, I suppose. More likely, if it's not, please keep us included if there's another bottleneck in connecting that you find.
> Dmitriy MiksIr wrote: -- Chad Miller, Software Developer chad@mysql.com MySQL Inc., www.mysql.com Orlando, Florida, USA 13-20z, UTC-0400 Office: +1 408 213 6740 sip:6740@sip.mysql.comReceived on Wed Sep 19 10:05:09 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 07:59:31 EDT |
||||||||||
|
|||||||||||