Nodes are currently marked as up if the outgoing connection is
established. However, if the incoming connection is not yet
established then this node could send a request where the replying
node can not queue its reply. Wait until both directions are up
before marking a node as connected.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit
8c98c10f242bc722beffc711e85c0e4f2e74cd57)
/* the queue subsystem now owns this fd */
tnode->out_fd = -1;
- /* tell the ctdb layer we are connected */
- node->ctdb->upcalls->node_connected(node);
+ /*
+ * Mark the node to which this connection has been established
+ * as connected, but only if the corresponding listening
+ * socket is also connected
+ */
+ if (tnode->in_fd != -1) {
+ node->ctdb->upcalls->node_connected(node);
+ }
}
}
tnode->in_fd = fd;
-}
+
+ /*
+ * Mark the connecting node as connected, but only if the
+ * corresponding outbound connected is also up
+ */
+ if (tnode->out_queue != NULL) {
+ node->ctdb->upcalls->node_connected(node);
+ }
+ }
/*