mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-24 20:08:01 +00:00
MINOR: acme: schedule retries with a timer
Schedule the retries with a 3s exponential timer. This is a temporary mesure as the client should follow the Retry-After field for rate-limiting for every request (https://datatracker.ietf.org/doc/html/rfc8555#section-6.6)
This commit is contained in:
parent
768458a79e
commit
a96cbe32b6
12
src/acme.c
12
src/acme.c
@ -1659,7 +1659,7 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
||||
|
||||
ctx->http_state = http_st;
|
||||
ctx->state = st;
|
||||
|
||||
task->expire = TICK_ETERNITY;
|
||||
return task;
|
||||
|
||||
retry:
|
||||
@ -1668,8 +1668,14 @@ retry:
|
||||
|
||||
ctx->retries--;
|
||||
if (ctx->retries > 0) {
|
||||
ha_notice("acme: %s, retrying (%d/%d)...\n", errmsg ? errmsg : "", ACME_RETRY-ctx->retries, ACME_RETRY);
|
||||
task_wakeup(task, TASK_WOKEN_MSG);
|
||||
int delay = 1;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ACME_RETRY - ctx->retries; i++)
|
||||
delay *= 3000;
|
||||
ha_notice("acme: %s, retrying in %dms (%d/%d)...\n", errmsg ? errmsg : "", delay, ACME_RETRY-ctx->retries, ACME_RETRY);
|
||||
task->expire = tick_add(now_ms, delay);
|
||||
|
||||
} else {
|
||||
ha_notice("acme: %s, aborting. (%d/%d)\n", errmsg ? errmsg : "", ACME_RETRY-ctx->retries, ACME_RETRY);
|
||||
goto end;
|
||||
|
Loading…
Reference in New Issue
Block a user