From 5492f874d93698d78fd3d2bcb2fa6cc8e5ad5f2e Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 29 Mar 2016 13:49:11 +1100 Subject: [PATCH] ctdb-killtcp: Don't send initial tickle ACK during setup Since they're being done in batch, just schedule an event to traverse all the connections. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tools/ctdb_killtcp.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ctdb/tools/ctdb_killtcp.c b/ctdb/tools/ctdb_killtcp.c index cd016b867bf..0188b8b2ee4 100644 --- a/ctdb/tools/ctdb_killtcp.c +++ b/ctdb/tools/ctdb_killtcp.c @@ -289,20 +289,8 @@ static int ctdb_killtcp(struct tevent_context *ev, TEVENT_FD_READ, capture_tcp_handler, killtcp); tevent_fd_set_auto_close(killtcp->fde); - - /* We also need to set up some events to tickle all these connections - until they are all reset - */ - tevent_add_timer(ev, killtcp, tevent_timeval_current_ofs(1, 0), - ctdb_tickle_sentenced_connections, killtcp); } - /* tickle him once now */ - ctdb_sys_send_tcp( - &con->dst_addr, - &con->src_addr, - 0, 0, 0); - return 0; } @@ -392,6 +380,11 @@ int main(int argc, char **argv) killtcp->destructor_data = &done; talloc_set_destructor(killtcp, ctdb_killtcp_destructor); + /* Do the initial processing of connections */ + tevent_add_timer(ev, killtcp, + tevent_timeval_current_ofs(0, 0), + ctdb_tickle_sentenced_connections, killtcp); + while (!done) { tevent_loop_once(ev); } -- 2.47.3