The following recent commits implemented support for purging servers
and backends from the CLI:
0c6d8ee23fa5 ("MEDIUM: proxy: implement purge backend")
d4d8a762a0fd ("MEDIUM: server: implement "purge all servers" CLI")
410719abdc07 ("MEDIUM: server: implement "purge server" CLI")
At the moment, when it is detected that it is not possible to complete
the purge, a background task is scheduled to retry every second. However
tests show that most of the time the operation completes almost instantly
(typically less than 20ms in local tests), so it's a bit sad to wait for
a full second in this case. In addition, it requires to apply a longer
client timeout to the VTC than any previous test.
Ideally it would be nice to use a capped exponential growth for retries,
but even without going this far, a nice first approach that brings
immediate benefit is to wait a very short time before the first retry,
while keeping the 1-second delay for subsequent ones. It's easy to do
because the code that arms the initial retry is performed in the command
pasing function while the next retries are in the task itself. That's
what this commit does. Now most of these operations will be performed
in either 0.05s or 1.05s instead of 1s. And regtests are happy again.
if (!ret) {
px->flags |= PR_FL_TO_PURGE;
if (!tick_isset(px->purge_task->expire))
- px->purge_task->expire = tick_add(now_ms, 1000);
+ px->purge_task->expire = tick_add(now_ms, 50);
task_queue(px->purge_task);
ha_notice("Backend '%s' flagged for deletion.\n", px->id);
cli_msg(appctx, LOG_INFO, "Backend scheduled for purge.\n");
srv->flags |= SRV_F_TO_PURGE;
if (!tick_isset(be->purge_task->expire))
- be->purge_task->expire = tick_add(now_ms, 1000);
+ be->purge_task->expire = tick_add(now_ms, 50);
task_queue(be->purge_task);
ha_notice("Server '%s/%s' flagged for deletion.\n", be->id, srv->id);
cli_msg(appctx, LOG_INFO, "Server scheduled for purge.\n");
if (ctx->c1) {
if (!tick_isset(be->purge_task->expire))
- be->purge_task->expire = tick_add(now_ms, 1000);
+ be->purge_task->expire = tick_add(now_ms, 50);
task_queue(be->purge_task);
}