public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Frank Ch. Eigler" <fche@redhat.com>, elfutils-devel@sourceware.org
Subject: Re: rfc/patch: debuginfod client $DEBUGINFOD_PROGRESS env var
Date: Wed, 18 Dec 2019 21:27:00 -0000	[thread overview]
Message-ID: <f1eeed6344a967a2cbb97f20470d7af2abd87d3c.camel@klomp.org> (raw)
In-Reply-To: <20191213165707.GF13089@redhat.com>

Hi Frank,

On Fri, 2019-12-13 at 11:57 -0500, Frank Ch. Eigler wrote:
> Pushed the following additional patch to fche/debuginfod-progress-env.
> Hand-tested on a ginormous download with various length timeouts; hard
> to test reliably within the elfutils testsuite (esp after removal of
> that induced debuginfod-side wait).

The code looks good in general, do note that if you rebase/squash to
onto master there is a slight conflict with the curl_res/curlm_res
fixlet. Since GCC10 isn't out yet, just yell if this gives you trouble
and I do/test it for you.

> +static const long default_connect_timeout = 5;
> +static const long default_transfer_timeout = -1; /* unlimited */
> +

I would call it default_progress_timeout, because...

> @@ -492,7 +502,10 @@ debuginfod_query_server (debuginfod_client *c,
>                         CURLOPT_WRITEFUNCTION,
>                         debuginfod_write_callback);
>        curl_easy_setopt(data[i].handle, CURLOPT_WRITEDATA, (void*)&data[i]);
> -      curl_easy_setopt(data[i].handle, CURLOPT_TIMEOUT, (long) server_timeout);
> +      if (connect_timeout >= 0)
> +        curl_easy_setopt(data[i].handle, CURLOPT_CONNECTTIMEOUT, connect_timeout);
> +      if (transfer_timeout >= 0)
> +        curl_easy_setopt(data[i].handle, CURLOPT_TIMEOUT, transfer_timeout);
>        curl_easy_setopt(data[i].handle, CURLOPT_FILETIME, (long) 1);
>        curl_easy_setopt(data[i].handle, CURLOPT_FOLLOWLOCATION, (long) 1);
>        curl_easy_setopt(data[i].handle, CURLOPT_FAILONERROR, (long) 1);

I would add something like:

  /* Make sure there is at least some progress,
     try to get at least 1K per progress timeout seconds.  */
  curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 5 * 1024L);
  curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, progress_timeout);

The idea being that if we didn't at least get 1K per 5 seconds then the
connection is just so bad that it doesn't make sense to wait for it to
finish, since that will most likely be forever (or feel like it for the
user).

This might or might not be a separate timeout from the connect timeout,
but I think they are kind of the same thing.

Cheers,

Mark

  reply	other threads:[~2019-12-18 21:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 21:10 Frank Ch. Eigler
2019-12-10 23:01 ` Mark Wielaard
2019-12-12 17:18   ` Frank Ch. Eigler
2019-12-13 16:57     ` Frank Ch. Eigler
2019-12-18 21:27       ` Mark Wielaard [this message]
2019-12-19  0:47         ` Frank Ch. Eigler
2019-12-23  0:36           ` Mark Wielaard
2019-12-23  1:39             ` Frank Ch. Eigler
2020-01-02 16:08               ` Mark Wielaard
2020-01-02 16:45                 ` Frank Ch. Eigler
2020-01-09 23:14                   ` Mark Wielaard
2019-12-18 21:12     ` Mark Wielaard
2019-12-19  0:44       ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1eeed6344a967a2cbb97f20470d7af2abd87d3c.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).