From 84ca31fcca398b432a151702c0c71f3d13d4a0bc Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 25 Apr 2015 09:13:20 +1000 Subject: [PATCH] Drop stratifier id when client id is not found in connector --- src/connector.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/connector.c b/src/connector.c index 650e4921..b74e53fe 100644 --- a/src/connector.c +++ b/src/connector.c @@ -289,14 +289,19 @@ static void generator_drop_client(ckpool_t *ckp, const client_instance_t *client free(s); } -static void stratifier_drop_client(ckpool_t *ckp, const client_instance_t *client) +static void stratifier_drop_id(ckpool_t *ckp, const int64_t id) { char buf[256]; - sprintf(buf, "dropclient=%"PRId64, client->id); + sprintf(buf, "dropclient=%"PRId64, id); send_proc(ckp->stratifier, buf); } +static void stratifier_drop_client(ckpool_t *ckp, const client_instance_t *client) +{ + stratifier_drop_id(ckp, client->id); +} + /* Invalidate this instance. Remove them from the hashtables we look up * regularly but keep the instances in a linked list until their ref count * drops to zero when we can remove them lazily. Client must hold a reference @@ -681,6 +686,7 @@ static void send_client(cdata_t *cdata, int64_t id, char *buf) invalidate_client(ckp, cdata, client); } else { LOGINFO("Connector failed to find client id %"PRId64" to send to", id); + stratifier_drop_id(ckp, id); } free(buf); return;