]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-killtcp: Don't send initial tickle ACK during setup
authorMartin Schwenke <martin@meltin.net>
Tue, 29 Mar 2016 02:49:11 +0000 (13:49 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 1 Apr 2016 02:42:12 +0000 (04:42 +0200)
Since they're being done in batch, just schedule an event to traverse
all the connections.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tools/ctdb_killtcp.c

index cd016b867bfce4ffea01e6d48389874bc52caa63..0188b8b2ee42d77e9cdd251af0bcfd8a41903db4 100644 (file)
@@ -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);
        }