From 8e5cd0aa9d2f171a168a684296032a4dc2028159 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 16 Apr 2025 14:26:48 -0400 Subject: [PATCH] MT#55283 scale falloff Change-Id: Iab3a3bff3f32561166f9c3076125103c29b5ab1f --- recording-daemon/notify.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recording-daemon/notify.c b/recording-daemon/notify.c index 053a61fc1..9e137bbed 100644 --- a/recording-daemon/notify.c +++ b/recording-daemon/notify.c @@ -13,7 +13,7 @@ struct notif_req { int64_t retry_time; unsigned int retries; - unsigned int falloff; + int64_t falloff_us; }; @@ -143,17 +143,17 @@ fail: req->retries++; if (c) ilog(LOG_DEBUG, "Failed to perform HTTP notification for '%s%s%s': " - "Error while %s: %s. Will retry in %u seconds (#%u)", + "Error while %s: %s. Will retry in %" PRId64 " seconds (#%u)", FMT_M(req->name), err, curl_easy_strerror(ret), - req->falloff, req->retries); + req->falloff_us / 1000000L, req->retries); else ilog(LOG_DEBUG, "Failed to perform HTTP notification for '%s%s%s': " - "Failed to create CURL object. Will retry in %u seconds (#%u)", + "Failed to create CURL object. Will retry in %" PRId64 " seconds (#%u)", FMT_M(req->name), - req->falloff, req->retries); - req->retry_time = now_us() + req->falloff * 1000000L; // XXX scale to micro - req->falloff *= 2; + req->falloff_us / 1000000L, req->retries); + req->retry_time = now_us() + req->falloff_us; + req->falloff_us *= 2; pthread_mutex_lock(&timer_lock); g_tree_insert(notify_timers, req, req); @@ -320,7 +320,7 @@ void notify_push_output(output_t *o, metafile_t *mf, tag_t *tag) { notify_add_header(req, "X-Recording-Tag-Metadata: %s", tag->metadata); } - req->falloff = 5; // initial retry time + req->falloff_us = 5000000LL; // initial retry time g_thread_pool_push(notify_threadpool, req, NULL); }