From c70a69936177a888d8ea2d9979f5eeefd2f620d8 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 1 Aug 2026 19:58:47 +0200 Subject: [PATCH] statd: fix timeout errors from mDNS and status snapshots On systems with a big configuration, or many concurrent clients (CLI, web interface, NETCONF/RESTCONF), updating the mDNS neighbor table or taking a status snapshot could time out: statd[3658]: mdns: sr_apply_changes: Timeout expired statd[3658]: Error, getting operational data: User callback failed statd used the sysrepo default timeout (0) for these operations, too short when other clients keep the datastore busy. Use SYSREPO_TIMEOUT, 60 seconds, same as all other services. Signed-off-by: Joachim Wiberg --- doc/ChangeLog.md | 8 ++++++++ src/statd/avahi.c | 6 +++--- src/statd/journal.c | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 1828d1e8..9b67a92b 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -19,6 +19,14 @@ All notable changes to the project are documented in this file. - Fix annoying "cannot deselect all services" or reset to YANG default in the web interface's firewall configuration page +- Fix `statd` timeout warnings in the log. Updates to the mDNS neighbor + table, and status snapshots, could fail with: + + statd[3658]: mdns: sr_apply_changes: Timeout expired + statd[3658]: Error, getting operational data: User callback failed + + Such operations are now allowed up to 60 seconds to complete, same as for + other services in the system [v26.06.0][] - 2026-07-01 ------------------------- diff --git a/src/statd/avahi.c b/src/statd/avahi.c index b6619cc5..d54bf3c4 100644 --- a/src/statd/avahi.c +++ b/src/statd/avahi.c @@ -441,7 +441,7 @@ static void ds_push_resolver(struct mdns_ctx *ctx, struct avahi_service *svc, return; } - err = sr_apply_changes(ctx->sr_ses, 0); + err = sr_apply_changes(ctx->sr_ses, SYSREPO_TIMEOUT); if (err) ERROR("mdns: sr_apply_changes: %s", sr_strerror(err)); } @@ -470,7 +470,7 @@ static void ds_delete_neighbor(struct mdns_ctx *ctx, const char *hostname) static void ds_clear_all(struct mdns_ctx *ctx) { sr_delete_item(ctx->sr_ses, XPATH_BASE, 0); - sr_apply_changes(ctx->sr_ses, 0); + sr_apply_changes(ctx->sr_ses, SYSREPO_TIMEOUT); } /* -------------------------------------------------------------------------- @@ -641,7 +641,7 @@ static void service_browser_cb(AvahiServiceBrowser *b, } } - sr_apply_changes(ctx->sr_ses, 0); + sr_apply_changes(ctx->sr_ses, SYSREPO_TIMEOUT); break; } diff --git a/src/statd/journal.c b/src/statd/journal.c index b515c1f1..3b4870f7 100644 --- a/src/statd/journal.c +++ b/src/statd/journal.c @@ -133,7 +133,7 @@ static void journal_timer_cb(struct ev_loop *, struct ev_timer *w, int) * This triggers our own operational callbacks running in main thread */ DEBUG("Calling sr_get_data on session %p", jctx->sr_query_ses); - err = sr_get_data(jctx->sr_query_ses, "/*", 0, 0, 0, &sr_data); + err = sr_get_data(jctx->sr_query_ses, "/*", 0, SYSREPO_TIMEOUT, 0, &sr_data); if (err != SR_ERR_OK) { ERROR("Error, getting operational data: %s", sr_strerror(err)); sr_release_context(con);