[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] ra_serf and APR_EAGAIN handling

From: Lieven Govaerts <lgo_at_mobsol.be>
Date: Tue, 12 Jun 2012 13:01:16 +0200

On Tue, Jun 12, 2012 at 10:51 AM, Justin Erenkrantz
<justin_at_erenkrantz.com> wrote:
> It seems we've tweaked how we handle EAGAIN inside of ra_serf and are
> treating it as a critical error.
>
> Right now, what Johan is seeing with his anti-virus software is that
> we very often receive EAGAIN from the sockets.  However, we're
> treating EAGAIN as a fatal error inside of
> svn_ra_serf__context_run_wait().  I believe we ought to be handling
> EAGAIN specifically and just (re)run the serf context loop again.
>

That seems strange, serf_context_run is not documented to return
APR_EGAIN. While the response handler can return APR_EAGAIN, serf
itself will translate this to APR_SUCCESS. As a result, ra_serf
doesn't expect it and - rightfully IMO - treats it as an error.

Are you trying to solve this issue:
http://subversion.tigris.org/issues/show_bug.cgi?id=4175 ?
If so, the solution - as discussed in
http://svn.haxx.se/dev/archive-2012-05/0133.shtml - lies in getting
the response handler not labeling the request as done until the
complete response has been read, including retrying on APR_EAGAIN.

So I don't think this patch is a good idea. If the issue you're seeing
is not the above, I'm interested in knowing some more details.

> The patch below fixes Johan's situation...but, I'd appreciate some
> eyes on it before committing.  -- justin
>
> Index: subversion/libsvn_ra_serf/util.c
> ===================================================================
> --- subversion/libsvn_ra_serf/util.c    (revision 1349176)
> +++ subversion/libsvn_ra_serf/util.c    (working copy)
> @@ -734,6 +734,13 @@ svn_ra_serf__context_run_wait(svn_boolean_t *done,
>                                   _("Connection timed out"));
>         }
>
> +      if (err && APR_STATUS_IS_EAGAIN(err->apr_err))
> +        {
> +          svn_error_clear(err);
> +          err = SVN_NO_ERROR;
> +          status = APR_SUCCESS;
> +        }
> +
>       SVN_ERR(err);
>       if (status)
>         {

Lieven
Received on 2012-06-12 13:02:10 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.