++1. Thanks for catching this; it explains some weirdness I've been seeing lately!
On Aug 24, 2013, at 2:19 PM, Eric Covener <cove...@gmail.com> wrote: > On Sun, Jun 19, 2011 at 8:23 AM, <s...@apache.org> wrote: >> Author: sf >> Date: Sun Jun 19 12:23:42 2011 >> New Revision: 1137358 >> >> URL: http://svn.apache.org/viewvc?rev=1137358&view=rev >> Log: >> Some improvements for handling of many connections for MPM event: >> >> - Process lingering close asynchronously instead of tying up worker threads >> (based on patch by Jeff Trawick). >> > >> + /* socket is already in non-blocking state */ >> + do { >> + nbytes = sizeof(dummybuf); >> + rv = apr_socket_recv(csd, dummybuf, &nbytes); >> + } while (rv == APR_SUCCESS); >> + >> + if (!APR_STATUS_IS_EOF(rv)) { >> + return; >> + } >> + >> + rv = apr_pollset_remove(event_pollset, pfd); >> + AP_DEBUG_ASSERT(rv == APR_SUCCESS); > > I was looking at an issue in this area, it seems like the > corresponding code in ap_lingering_close is not so picky about > apr_socket_recv return code. It seems like we could continually get > ECONNABORTED/ECONNRESET back and not take the socket out of the ring > until the timeout elapses. > > I'm wondering if the test should be APR_STATUS_IS_EAGAIN(), and > anything else that isn't success means we no longer need to linger? >