Skip to content

Commit

Permalink
scheduler: do not remove the 'retry request' context before perform t…
Browse files Browse the repository at this point in the history
…he retry

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Dec 12, 2019
1 parent aa5d59f commit 81e4d54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/flb_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ int flb_sched_request_destroy(struct flb_config *config,
{
struct flb_sched_timer *timer;

if (!req) {
return 0;
}

mk_list_del(&req->_head);

timer = req->timer;
Expand Down Expand Up @@ -364,11 +368,11 @@ int flb_sched_event_handler(struct flb_config *config, struct mk_event *event)
req = timer->data;
consume_byte(req->fd);

/* Destroy this scheduled request, it's not longer required */
flb_sched_request_destroy(config, req);

/* Dispatch 'retry' */
flb_engine_dispatch_retry(req->data, config);

/* Destroy this scheduled request, it's not longer required */
flb_sched_request_destroy(config, req);
}
else if (timer->type == FLB_SCHED_TIMER_FRAME) {
sched = timer->data;
Expand Down

0 comments on commit 81e4d54

Please sign in to comment.