From d20a639eb3c57b0bc71e6effe8db6d4bcb285bf8 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Mon, 19 Sep 2011 14:20:25 -0400 Subject: [PATCH] sm-notify: Avoid extra rpcbind queries The logic in notify_host() watches the host->retries counter to see if progress is not being made. If progress stalls, notify_host() tries another IP address. This means sm-notify will generate a fresh rpcbind query. After an RPC succeeds, be sure to reset host->retries so sm-notify doesn't start walking down the host's addrinfo list when we _are_ making progress. In the common case, if the host responds, we avoid extra rpcbind queries and send all requests for the host to the same IP address. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- utils/statd/sm-notify.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c index aa202d3..690ec2a 100644 --- a/utils/statd/sm-notify.c +++ b/utils/statd/sm-notify.c @@ -699,6 +699,7 @@ smn_defer(struct nsm_host *host) static void smn_schedule(struct nsm_host *host) { + host->retries = 0; host->xid = 0; host->send_next = time(NULL); host->timeout = NSM_TIMEOUT; -- 2.39.5