Geoff Greer
Wed, 07 May 2008 14:58:45 -0700
OK, so there are two problems here: 1. Timeout sockets are broken in r654185. To test this cd to apr/test, make, then run ./sendfile server & ./sendfile client timeout Of course reverting the change (adding the rv=0 line again) causes the httpd tests to fail. I don't have the httpd tests set up on my machine yet, so there's not much I can do about this. Still, it's almost definitely a bug in apr_socket_sendfile(). 2. httpd on OS X sometimes hangs for a couple seconds. This could have many causes, including a kernel bug. I don't know what version of apr and httpd Dirk was using, but anything outside the 1.3 branch or trunk on 10.5 has sendfile disabled on OS X. On IRC he mentioned people complaining about this bug in the wild, which seems unusual considering how recent the code is. It would be nice if there was a test case for this that wasn't as complicated as running httpd and getting a file. I'm on 10.5 and I've been running httpd 2.2.8 compiled with apr and apr-util from a recent version of trunk without any issues, but my macbook isn't exactly a high-load production machine. Geoff > > On May 7, 2008, at 8:58 PM, Mads Toftum wrote: > >> On Wed, May 07, 2008 at 02:50:46PM -0400, Jim Jagielski wrote: >>> To clarify: I have no idea what you are referring to >>> as far as what issue you were discussing. This is >>> because it was on IRC. For myself and everyone else who >>> did not happen to be on IRC at that moment of time, we >>> have no idea what this is all about. >>> >> 18:26 < dirkx> Quick thought anyone.... with a"curl --silent -o >> /dev/null -vv http://localhost:8080/manual/images/feather.gif" on a >> basic apache (default install, yadayada) on macosx -- response is >> immediate. >> >> 18:27 < dirkx> But with curl --silent -o /dev/null -vv >> http://localhost:8080/manual/images/feather.gif?x --- note the ?x at >> the >> end -- delay of 2-3 seconds before the reply is streamed on the wire. >> >> 18:54 < dirkx> Ah - if I use the '-X' flag -- it is virtually always >> there. >> >> 19:01 < dirkx> Hmm - a 'Connection: close' in the request header sorts >> it out sure. >> 19:01 < dirkx> Kind of interesting -- dtrace() shows you: >> 19:01 < dirkx> >> open("/Users/dirkx/tmp/apache-httpd-26044/manual/images/feather.gif >> \0", >> 0x0, 0x0)II = 10 0 >> 19:02 < dirkx> etsockopt(0x9, 0x6, 0x1)II = 0 0 >> 19:02 < dirkx> setsockopt(0x9, 0x6, 0x4)II = 0 0 >> 19:02 < dirkx> writev(0x9, 0xBFFFEE74, 0x1)II = 245 0 >> 19:02 < dirkx> sendfile(0xA, 0x9, 0x0)II = 0 0 >> 19:02 < dirkx> ... write to log file ... >> 19:02 < dirkx> close(0xA)II = 0 0 >> 19:02 < dirkx> read(0x9, " ---> returns -1 >> 19:02 < dirkx> ... then waits.... >> 19:02 < dirkx> waits... >> 19:03 < dirkx> And then the actual reply goes out by TCP simultaneous >> with: >> 19:03 < dirkx> poll(0xBFFFF228, 0x1, 0x1388)II = 1 0 >> 19:03 < dirkx> read(0x9, "\0", 0x1F40)II = 0 0 >> 19:03 < dirkx> shutdown(0x9, 0x1, 0x173460)II = 0 0 >> 19:03 < dirkx> poll(0xBFFFF558, 0x1, 0x7D0)II = 1 0 >> 19:03 < dirkx> read(0x9, "\0", 0x200)II = 0 0 >> 19:03 < dirkx> close(0x9)II = 0 0 >> 19:03 < dirkx> read(0x5, "\0", 0x1)II = -1 Err#35 >> 19:03 < dirkx> As if the 'sendfile' 'hangs' until that happens. >> >> I think that's all of it. > > More recent from thereon > > - Folloow up on Quasi -- try EnableSendFile on/off > > - Makes it perfectly reproducable > > - Try patch r654185 - which does not quite fix it. > > and that is about it. > > Dw >