You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/05/18 17:53:37 UTC

DO NOT REPLY [Bug 39605] - core_output_filter sends misaligned chunks after timeout

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39605>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39605


slamb@slamb.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Bad core_output_filter      |core_output_filter sends
                   |EAGAIN behavior             |misaligned chunks after
                   |                            |timeout




------- Additional Comments From slamb@slamb.org  2006-05-18 15:53 -------
Tested it this morning; my fix was not enough.

Stepping back a second, I see this on an strace of brokenness:

here it's trying to send a 130203-byte chunk. Only 27487 bytes get sent out, leaving 102716.

    writev(12, [{"1fc9b\r\n", 7}, {"5xwAAIagAJRlhdwPgIoCRoJ0lkWDEICH"..., 3611}, 
{"QtsAfKloOGu5EQW50evUC2wwSilrLzKE"..., 126592}, {"\r\n", 2}], 4) = 27494

Here it succeeds in sending 66608 bytes, leaving 36108.

    poll([{fd=12, events=POLLOUT, revents=POLLOUT}], 1, 120000) = 1
    writev(12, [{"IEBwkBEAAABQMCAwMIBwUJAgMEBREGBw"..., 102716}, {"\r\n", 2}], 2) = 66608

Here it succeeds in sending 33304 bytes, leaving 2804.

    poll([{fd=12, events=POLLOUT, revents=POLLOUT}], 1, 120000) = 1
    writev(12, [{"ePFoc8+VaNcmDB5ycecSbTE9/Ps2R7ch"..., 36108}, {"\r\n", 2}], 2) = 33304

...next write times out:

    poll([{fd=12, events=POLLOUT}], 1, 120000) = 0
    [...some reads from another descriptor...]

And here it goes on to the next chunk, completely forgetting about those 2804 bytes.

    writev(12, [{"12e8e\r\n", 7}, {"AACD4lSOD4OxYICVU1GVF41QlFGFRZRl"..., 2452}, {"hDB/
jOkpPxHqDQJh4NcLNujizjHb8wSl"..., 75002}, {"\r\n", 2}], 4) = 10136

With the patch below and another one that makes writev_it_all log everything (different run), I see this:

[Thu May 18 08:32:42 2006] [error] writev_it_all 130212 bytes: take 1: apr_sendv 130212 bytes -> 
27494
[Thu May 18 08:32:42 2006] [error] writev_it_all 130212 bytes: take 2: apr_sendv 102718 bytes -> 
66608
[Thu May 18 08:32:42 2006] [error] writev_it_all 130212 bytes: take 3: apr_sendv 36110 bytes -> 
33304
[Thu May 18 08:34:42 2006] [error] (70007)The timeout specified has expired: writev_it_all 130212 
bytes: take 4: apr_sendv 2806 bytes -> 0
[Thu May 18 08:34:42 2006] [info] (70007)The timeout specified has expired: core_output_filter: 
writing data to the network
[Thu May 18 08:34:42 2006] [error] writev_it_all 77463 bytes: take 1: apr_sendv 77463 bytes -> 10136

There are two problems here:

(1) APR_TIMEUP; our network's pretty messed up right now so this isn't that surprising.

(2) core_output_filter sees the error and gives up on data it has to send without aborting the 
connection, causing further chunks to be messed up and diagnosis to be frustrating.

I opened this bug for #2. Apparently setting c->aborted isn't enough, though it looks like a bunch of 
callers check it before writing stuff. I'll look around a bit more.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org