summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctdb/tcp/tcp_connect.c4
-rw-r--r--ctdb/tcp/tcp_io.c9
2 files changed, 6 insertions, 7 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index 9fc322fde5..6074b646aa 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -63,6 +63,10 @@ static void ctdb_node_connect_write(struct event_context *ev, struct fd_event *f
/* tell the ctdb layer we are connected */
node->ctdb->upcalls->node_connected(node);
+
+ if (tnode->queue) {
+ EVENT_FD_WRITEABLE(tnode->fde);
+ }
}
/*
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index 67a6bc4b3b..d572ba533f 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -151,14 +151,9 @@ int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
struct ctdb_tcp_node);
struct ctdb_tcp_packet *pkt;
- if (tnode->fd == -1) {
- ctdb_set_error(node->ctdb, "Sending to dead node %s\n", node->name);
- return -1;
- }
-
/* if the queue is empty then try an immediate write, avoiding
queue overhead. This relies on non-blocking sockets */
- if (tnode->queue == NULL) {
+ if (tnode->queue == NULL && tnode->fd != -1) {
ssize_t n = write(tnode->fd, data, length);
if (n == -1 && errno != EAGAIN && errno != EWOULDBLOCK) {
event_add_timed(node->ctdb->ev, node, timeval_zero(),
@@ -182,7 +177,7 @@ int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
pkt->length = length;
- if (tnode->queue == NULL) {
+ if (tnode->queue == NULL && tnode->fd != -1) {
EVENT_FD_WRITEABLE(tnode->fde);
}