From 5851bf4d73fdab8634e2098e73eaef396504ed74 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 5 Nov 2008 09:02:28 -0500 Subject: Set floor to ping time or the monitor will get crazy trying to ping children thousands of times per second. --- server/monitor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/monitor.c b/server/monitor.c index 1afebd51..c5d5781f 100644 --- a/server/monitor.c +++ b/server/monitor.c @@ -32,6 +32,10 @@ #include "sbus/sssd_dbus.h" #include "sbus_interfaces.h" +/* ping time cannot be less then once every few seconds or the + * monitor will get crazy hammering children with messages */ +#define MONITOR_MIN_PING_TIME 2 + struct mt_conn { struct sbus_conn_ctx *conn_ctx; struct mt_svc *svc_ptr; @@ -257,10 +261,12 @@ int get_monitor_config(struct mt_ctx *ctx) ret = confdb_get_int(ctx->cdb, ctx, "config.services.monitor", "servicePingTime", - -1, &ctx->service_ping_time); + MONITOR_MIN_PING_TIME, &ctx->service_ping_time); if (ret != EOK) { return ret; } + if (ctx->service_ping_time < MONITOR_MIN_PING_TIME) + ctx->service_ping_time = MONITOR_MIN_PING_TIME; ret = confdb_get_param(ctx->cdb, ctx, "config.services", "activeServices", -- cgit