cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: First attempt at --retry!

From: David Byron <DByron_at_everdreamcorp.com>
Date: Fri, 29 Oct 2004 09:36:23 -0700

I had trouble getting this through the first time...Sorry if you get
this twice...

-DB

On Wed, 27 October 2004, Daniel Stenberg wrote:

> I've just committed my first take at implementing --retry
> and --retry-delay.
>
> With --retry [num] you tell curl how many times to retry a
> request if a transient error is returned (or a timeout).
>
> With --retry-delay [num] you set the number of seconds to
> wait between each retry to override the default backoff
> algorithm: by default, curl will first wait one second
> between them and then double the waiting between each retry
> until it reaches 10 minutes.

Thanks for this. I should have chimed in before, but we've implemented
this slightly differently. It means a couple more options, but maybe
people like it better enough to make it worthwhile...

For, --retry-delay is the number of seconds to wait between attempts.
With no other options, we use the same delay between each attempt. For
behavior similar to what you've done, we also have --backoff. When
--backoff is specified, we use --retry-delay as the initial delay and
double it for each subsequent attempt. The maximum time we delay is
controlled by --max-retry-delay. If --max-retry-delay isn't specified,
we use 1 hour as the default.

So, it's a little more complicated, and in truth we pretty much always
use --backoff. --max-retry-delay might be nice though.

For the curious, there are a couple more details. If neither --backoff
nor --retry-delay is specified, we don't wait at all between attempts.
If --backoff is specified, but --retry-delay isn't, the initial delay
between attempts is 1 second.

Thoughts?

-DB
Received on 2004-11-01