diff options
author | Martin Schwenke <martin@meltin.net> | 2016-03-23 08:26:36 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2016-04-01 04:42:12 +0200 |
commit | 93f3cd66506373d842dc2dc7a1a678109410ac8e (patch) | |
tree | 40ba58b0d898be96976a4d0b5804d1af315f2a3a | |
parent | 402f3c0460f072c316bc8f0b28c2adf7164b513c (diff) | |
download | samba-93f3cd66506373d842dc2dc7a1a678109410ac8e.tar.gz |
ctdb-killtcp: Don't count attempts for individual connections
This made sense when connections were individually queued in the
daemon. However, they're now done in batch so just keep an overall
count.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r-- | ctdb/tools/ctdb_killtcp.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/ctdb/tools/ctdb_killtcp.c b/ctdb/tools/ctdb_killtcp.c index b305b71efb4..b1898d73eda 100644 --- a/ctdb/tools/ctdb_killtcp.c +++ b/ctdb/tools/ctdb_killtcp.c @@ -51,7 +51,6 @@ static const char *prog; struct ctdb_killtcp_con { ctdb_sock_addr src_addr; ctdb_sock_addr dst_addr; - int count; struct ctdb_kill_tcp *killtcp; }; @@ -171,14 +170,6 @@ static int tickle_connection_traverse(void *param, void *data) { struct ctdb_killtcp_con *con = talloc_get_type(data, struct ctdb_killtcp_con); - /* have tried too many times, just give up */ - if (con->count >= con->killtcp->max_attempts) { - /* can't delete in traverse: reparent to delete_cons */ - talloc_steal(param, con); - return 0; - } - - con->count++; ctdb_sys_send_tcp(&con->dst_addr, &con->src_addr, 0, 0, 0); return 0; @@ -203,11 +194,12 @@ static void ctdb_tickle_sentenced_connections(struct tevent_context *ev, killtcp->attempts++; - /* If there are no more connections to kill we can remove the - entire killtcp structure + /* If there are no more connections to kill or we have tried + too many times we can remove the entire killtcp structure */ - if ((killtcp->connections == NULL) || - (killtcp->connections->root == NULL)) { + if (killtcp->connections == NULL || + killtcp->connections->root == NULL || + killtcp->attempts >= killtcp->max_attempts) { talloc_free(killtcp); return; } @@ -279,7 +271,6 @@ static int ctdb_killtcp(struct tevent_context *ev, } con->src_addr = *src; con->dst_addr = *dst; - con->count = 0; con->killtcp = killtcp; |