summaryrefslogtreecommitdiff
path: root/ctdb/tcp
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-15 11:24:54 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-15 11:24:54 +1100
commit9de365238076601f4e0f776321c0c69d8c15f3dc (patch)
tree94ec50b8a83dd14609d09fba924b77f3138a15d6 /ctdb/tcp
parent6152a7060bf007ee6f8fea66ee921ff963bd826b (diff)
downloadsamba-9de365238076601f4e0f776321c0c69d8c15f3dc.tar.gz
add logging everytime we create a filedescriptor in the main ctdb daemon
so we can spot if there are leaks. plug two leaks for filedescriptors related to when sending ARP fail and one leak when we can not parse the local address during tcp connection establish (This used to be ctdb commit ddd089810a14efe4be6e1ff3eccaa604e4913c9e)
Diffstat (limited to 'ctdb/tcp')
-rw-r--r--ctdb/tcp/tcp_connect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index e3d7772ae4e..20748606018 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -158,6 +158,8 @@ void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te,
set_nonblocking(tnode->fd);
set_close_on_exec(tnode->fd);
+ DEBUG(DEBUG_NOTICE, (__location__ " Created TCP SOCKET FD:%d\n", tnode->fd));
+
/* Bind our side of the socketpair to the same address we use to listen
* on incoming CTDB traffic.
* We must specify this address to make sure that the address we expose to
@@ -166,6 +168,8 @@ void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te,
*/
ZERO_STRUCT(sock_in);
if (ctdb_tcp_get_address(ctdb, ctdb->address.address, &sock_in) != 0) {
+ DEBUG(DEBUG_ERR, (__location__ " Failed to find our address. Failing bind.\n"));
+ close(tnode->fd);
return;
}
@@ -186,6 +190,7 @@ void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te,
default:
DEBUG(DEBUG_ERR, (__location__ " unknown family %u\n",
sock_in.sa.sa_family));
+ close(tnode->fd);
return;
}
#ifdef HAVE_SOCK_SIN_LEN
@@ -253,6 +258,8 @@ static void ctdb_listen_event(struct event_context *ev, struct fd_event *fde,
set_nonblocking(in->fd);
set_close_on_exec(in->fd);
+ DEBUG(DEBUG_NOTICE, (__location__ " Created SOCKET FD:%d to incoming ctdb connection\n", fd));
+
setsockopt(in->fd,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(one));
in->queue = ctdb_queue_setup(ctdb, in, in->fd, CTDB_TCP_ALIGNMENT,