httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44584] ab.c: EINTR not checked when calling apr_socket_connect()
Date Mon, 19 Jan 2009 00:51:33 GMT

--- Comment #5 from Jeff Trawick <>  2009-01-18 16:51:32 PST ---
>apr_socket_connect(): Operation already in progress (37)
>Total of 55 requests completed

This happens on Leopard too and is related to the kqueue usage, so the problem
could be in APR.

ab occasionally is awoken from kevent() with a notification for a socket which
is in the process of connecting but has not yet completed.  ab thinks the
condition must mean connect-complete, calls apr_socket_connect(), gets EALREADY
(37), and bombs.

My unproven impression is that ab isn't keeping the pollset minimized (i.e.,
not removing items from the pollset as soon as it stops needing to be notified
for them, but I'm not sure.

FWIW, a hack like this keeps ab going:

             if (rv & APR_POLLOUT) {
                 if (c->state == STATE_CONNECTING) {
                     apr_pollfd_t remove_pollfd;
                     rv = apr_socket_connect(c->aprsock, destsa);
+                    if (rv == 37) {
+                        continue;
+                    }
                     remove_pollfd.desc_type = APR_POLL_SOCKET;
                     remove_pollfd.desc.s = c->aprsock;
                     apr_pollset_remove(readbits, &remove_pollfd);

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message