From 26b4037effb2d66f102574bed40c51007d61b52c Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 3 Oct 2014 22:41:32 +1000 Subject: [PATCH] Log a warning if a client with an invalidated fd is still in the fdclients hashtable --- src/connector.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/connector.c b/src/connector.c index 7c9e28b1..083e6b9e 100644 --- a/src/connector.c +++ b/src/connector.c @@ -286,6 +286,11 @@ retry: ck_rlock(&ci->lock); HASH_ITER(fdhh, fdclients, client, tmp) { + if (unlikely(client->fd == -1)) { + LOGWARNING("Client id %d is still in fdclients hashtable with invalidated fd!", + client->id); + continue; + } fds[nfds].fd = client->fd; fds[nfds].events = POLLIN; fds[nfds].revents = 0;