diff options
author | Simo Sorce <idra@samba.org> | 2008-11-05 09:02:28 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-11-05 13:22:50 -0500 |
commit | 5851bf4d73fdab8634e2098e73eaef396504ed74 (patch) | |
tree | 94fbb205af5f75525ed8e91cac293b4e8deb341e | |
parent | ef31ca14cc3c3c05020847fc46d96ec9842af704 (diff) | |
download | sssd-5851bf4d73fdab8634e2098e73eaef396504ed74.tar.gz sssd-5851bf4d73fdab8634e2098e73eaef396504ed74.tar.bz2 sssd-5851bf4d73fdab8634e2098e73eaef396504ed74.zip |
Set floor to ping time or the monitor will get crazy trying to ping
children thousands of times per second.
-rw-r--r-- | server/monitor.c | 8 |
1 files changed, 7 insertions, 1 deletions
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", |