]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tcp: Drop tracking of file descriptor for incoming connections
authorMartin Schwenke <martin@meltin.net>
Tue, 29 Oct 2019 06:28:22 +0000 (17:28 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 6 Nov 2019 01:22:30 +0000 (01:22 +0000)
This file descriptor is owned by the incoming queue.  It will be
closed when the queue is torn down.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14175
RN: Avoid communication breakdown on node reconnect

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tcp/ctdb_tcp.h
ctdb/tcp/tcp_connect.c
ctdb/tcp/tcp_init.c
ctdb/tcp/tcp_io.c

index 9a615fc6393d494349a732abe86fd9ac0f88c2f9..daabad74297e2e2168228a6d531b227f11841354 100644 (file)
@@ -37,7 +37,6 @@ struct ctdb_tcp_node {
        struct tevent_timer *connect_te;
 
        struct ctdb_context *ctdb;
-       int in_fd;
        struct ctdb_queue *in_queue;
 };
 
index df115b783e0706b4b557e195559b6dd275c71c31..a75f35a809ed8a90980557e17b1800fe2880b593 100644 (file)
@@ -355,8 +355,6 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
                return;
        }
 
-       tnode->in_fd = fd;
-
        /*
        * Mark the connecting node as connected, but only if the
        * corresponding outbound connected is also up
index a9cb9b36a01cbe49753e75af7a02ae7f6c52361c..3be16bd7d5eafa35fff28e29395ab9a04fd0a26f 100644 (file)
@@ -43,11 +43,6 @@ static int tnode_destructor(struct ctdb_tcp_node *tnode)
                tnode->out_fd = -1;
        }
 
-       if (tnode->in_fd != -1) {
-               close(tnode->in_fd);
-               tnode->in_fd = -1;
-       }
-
        return 0;
 }
 
@@ -61,7 +56,6 @@ static int ctdb_tcp_add_node(struct ctdb_node *node)
        CTDB_NO_MEMORY(node->ctdb, tnode);
 
        tnode->out_fd = -1;
-       tnode->in_fd = -1;
        tnode->ctdb = node->ctdb;
 
        node->private_data = tnode;
index e8ebff887e13a93f948d380d2d6bdd2a12777e28..2d8ec0f706219ab6370bafacfd0ef56d20b9f0d6 100644 (file)
@@ -76,8 +76,6 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
 
 failed:
        TALLOC_FREE(tnode->in_queue);
-       close(tnode->in_fd);
-       tnode->in_fd = -1;
        node->ctdb->upcalls->node_dead(node);
 
        TALLOC_FREE(data);