From df8d11e0faa926cece108ec61492755cd2994f8a Mon Sep 17 00:00:00 2001 From: pugkung Date: Tue, 6 Oct 2020 07:20:23 +0700 Subject: [PATCH] task: fix typo messages and variables name 'attemps' to 'attempts' (#2636) Signed-off-by: Tanapol Rattanapichetkul --- include/fluent-bit/flb_task.h | 2 +- src/flb_engine.c | 2 +- src/flb_task.c | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/fluent-bit/flb_task.h b/include/fluent-bit/flb_task.h index 5d25fc96b4c..017e633d15c 100644 --- a/include/fluent-bit/flb_task.h +++ b/include/fluent-bit/flb_task.h @@ -65,7 +65,7 @@ struct flb_task_route { * task data to the desired output path. */ struct flb_task_retry { - int attemps; /* number of attemps, default 1 */ + int attempts; /* number of attempts, default 1 */ struct flb_output_instance *o_ins; /* route that we are retrying */ struct flb_task *parent; /* parent task reference */ struct mk_list _head; /* link to parent task list */ diff --git a/src/flb_engine.c b/src/flb_engine.c index 833c12d11dd..fddab250863 100644 --- a/src/flb_engine.c +++ b/src/flb_engine.c @@ -234,7 +234,7 @@ static inline int flb_engine_manager(flb_pipefd_t fd, struct flb_config *config) /* Let the scheduler to retry the failed task/thread */ retry_seconds = flb_sched_request_create(config, - retry, retry->attemps); + retry, retry->attempts); /* * If for some reason the Scheduler could not include this retry, diff --git a/src/flb_task.c b/src/flb_task.c index 0f7dfae6332..9c55371cef1 100644 --- a/src/flb_task.c +++ b/src/flb_task.c @@ -92,7 +92,7 @@ int flb_task_retry_reschedule(struct flb_task_retry *retry, struct flb_config *c struct flb_task *task; task = retry->parent; - seconds = flb_sched_request_create(config, retry, retry->attemps); + seconds = flb_sched_request_create(config, retry, retry->attempts); if (seconds == -1) { /* * This is the worse case scenario: 'cannot re-schedule a retry'. If the Chunk @@ -128,9 +128,9 @@ struct flb_task_retry *flb_task_retry_create(struct flb_task *task, mk_list_foreach_safe(head, tmp, &task->retries) { retry = mk_list_entry(head, struct flb_task_retry, _head); if (retry->o_ins == o_ins) { - if (retry->attemps >= o_ins->retry_limit && o_ins->retry_limit >= 0) { - flb_debug("[task] task_id=%i reached retry-attemps limit %i/%i", - task->id, retry->attemps, o_ins->retry_limit); + if (retry->attempts >= o_ins->retry_limit && o_ins->retry_limit >= 0) { + flb_debug("[task] task_id=%i reached retry-attempts limit %i/%i", + task->id, retry->attempts, o_ins->retry_limit); flb_task_retry_destroy(retry); return NULL; } @@ -147,18 +147,18 @@ struct flb_task_retry *flb_task_retry_create(struct flb_task *task, return NULL; } - retry->attemps = 1; + retry->attempts = 1; retry->o_ins = o_ins; retry->parent = task; mk_list_add(&retry->_head, &task->retries); - flb_debug("[retry] new retry created for task_id=%i attemps=%i", - out_th->task->id, retry->attemps); + flb_debug("[retry] new retry created for task_id=%i attempts=%i", + out_th->task->id, retry->attempts); } else { - retry->attemps++; - flb_debug("[retry] re-using retry for task_id=%i attemps=%i", - out_th->task->id, retry->attemps); + retry->attempts++; + flb_debug("[retry] re-using retry for task_id=%i attempts=%i", + out_th->task->id, retry->attempts); } /* @@ -199,7 +199,7 @@ int flb_task_retry_count(struct flb_task *task, void *data) mk_list_foreach(head, &task->retries) { retry = mk_list_entry(head, struct flb_task_retry, _head); if (retry->o_ins == o_ins) { - return retry->attemps; + return retry->attempts; } }