Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task: fix typo messages and variables name 'attemps' to 'attempts' #2636

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/fluent-bit/flb_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/flb_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 11 additions & 11 deletions src/flb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}

/*
Expand Down Expand Up @@ -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;
}
}

Expand Down