In hld_strm_task(), stream errors triggered an unconditional task_wakeup()
on the user task. This bypassed arg_rate and caused haload to send connection
retries as fast as possible instead of respecting the configured request rate.
Call hld_usr_schedule() when arg_rate is set to guarantee that
rate pacing is preserved even when streams fail.
/* Note that the user task will release all the expired streams
* attached to it.
*/
- task_wakeup(usr->task, TASK_WOKEN_IO);
+ if (!arg_rate)
+ task_wakeup(usr->task, TASK_WOKEN_IO);
+ else
+ hld_usr_schedule(usr, arg_rate);
LIST_DELETE(&hs->list);
hldstream_free(&hs);
t = NULL;