httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@clove.org>
Subject Re: Small patch to ab apr_socket_recv error handling
Date Tue, 27 Feb 2007 17:56:40 GMT
Apache shouldn't be prematurely disconnecting sockets in the middle
of a response unless there is a serious problem (Eg. the Apache
child process is crashing). Could you describe how to reproduce this?

As for the patch, could you make this configurable with a command-line
option? That way the current functionality can stay default (meaning,
all recv() errors are fatal) and for those circumstances where the
user knows that there is some network-level or Apache-level problem
causing intermittent recv() errors, they can still get performance
results out of AB.

-aaron


On Mon, Feb 26, 2007 at 01:06:14PM -0700, Filip Hanik - Dev Lists wrote:
> I've created a small patch that lets ab continue even if it encounters 
> an error on apr_socket_recv
> 
> quite commonly, when servers are overloaded they disconnect the socket, 
> ab receives a 104 (connection reset by peer) and the ab test exits.
> 
> This patch logs the error, both counters correctly, cleans up the 
> connection and continues.
> 
> thoughts?
> 
> Filip

> Index: ab.c
> ===================================================================
> --- ab.c	(revision 511976)
> +++ ab.c	(working copy)
> @@ -1332,7 +1332,10 @@
>              err_except++; /* XXX: is this the right error counter? */
>              /* XXX: Should errors here be fatal, or should we allow a
>               * certain number of them before completely failing? -aaron */
> -            apr_err("apr_socket_recv", status);
> +            //apr_err("apr_socket_recv", status);
> +            bad++;
> +            close_connection(c);
> +            return;
>          }
>      }
>  


Mime
View raw message