From dda6e8560ea73837c0d7193426c659e81c8b8f7e Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 11 Aug 2009 10:46:08 -0400 Subject: [PATCH] Fix monitor ping timeout Our configuration specifies the monitor config timeout as seconds, but we were passing it directly to dbus commands that require milliseconds. Fixing this in get_monitor_config(). Also, the default value of -1 for the timeout resulted in a timeout much too short to be useful, so I'm making it 10s instead. This fix solves the problem where a busy backend (for example, one that is enumerating a large number of LDAP entries) would fail to respond to the ping in time. --- server/monitor/monitor.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c index bc809ae..2ffd663 100644 --- a/server/monitor/monitor.c +++ b/server/monitor/monitor.c @@ -809,14 +809,17 @@ static int append_data_provider(struct mt_ctx *ctx) int get_monitor_config(struct mt_ctx *ctx) { int ret; + int timeout_seconds; ret = confdb_get_int(ctx->cdb, ctx, MONITOR_CONF_ENTRY, "sbusTimeout", - -1, &ctx->service_id_timeout); + 10, &timeout_seconds); if (ret != EOK) { return ret; } + ctx->service_id_timeout = timeout_seconds * 1000; /* service_id_timeout is in ms */ + ctx->service_ctx = talloc_new(ctx); if(!ctx->service_ctx) { return ENOMEM; -- 1.6.2.5