Skip to content

RT-1029 Fix for repeated logs by increasing throttle timer #20

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions recording-daemon/mix.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,17 @@ static int mix_get_frame_and_output(mix_t *mix, output_t *output) {
return ret;
}

#define MIX_TIMER_INTERVAL 1
#define MIX_TIMER_INTERVAL 10

static void log_repeated_error(int err_count, const char* err, int ret, const char * call_id){
char errmsg[256];
errmsg[0] = 0;
av_strerror(ret, errmsg, sizeof(errmsg));
if (err != NULL && err_count > 0) {
if (err_count == 1)
ilog(LOG_ERR, "[%s] Failure in max_add: %s(ret=%d, err=%s)",call_id, err, ret, errmsg);
ilog(LOG_ERR, "[%s] Failure in mix_add: %s(ret=%d, err=%s)",call_id, err, ret, errmsg);
else
ilog(LOG_ERR, "[%s] Failure in max_add: %s (ret=%d, err=%s, happened %d times in last %d seconds)",
ilog(LOG_ERR, "[%s] Failure in mix_add: %s (ret=%d, err=%s, happened %d times in last %d seconds)",
call_id, err, ret, errmsg, err_count, MIX_TIMER_INTERVAL);
}
}
Expand All @@ -244,7 +244,6 @@ static void throttle_error_output(const char* err, int ret, const char * call_id
err_count++;
return;
}
log_repeated_error(err_count, last_err, last_ret,call_id);
log_repeated_error(1, err, ret,call_id); // output new error immediately
last_err = err;
last_ret = ret;
Expand Down