From c431a065ba515d27830f01c852f70940efb3003b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 2 Jul 2015 11:13:32 +0200 Subject: ose: Remove all code related to the OSE port The OSE port is no longer supported and this commit removed it and any changes related to it. The things that were general improvements have been left in the code. --- erts/epmd/src/epmd_srv.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'erts/epmd/src/epmd_srv.c') diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index 8c8d7304f2..829eb4c74d 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -30,11 +30,6 @@ # define INADDR_NONE 0xffffffff #endif -#if defined(__OSE__) -# include "sys/ioctl.h" -# define sleep(x) delay(x*1000) -#endif - /* * * This server is a local name server for Erlang nodes. Erlang nodes can @@ -315,7 +310,7 @@ void run(EpmdVars *g) } #endif /* HAVE_SYSTEMD_DAEMON */ -#if !defined(__WIN32__) && !defined(__OSE__) +#if !defined(__WIN32__) /* We ignore the SIGPIPE signal that is raised when we call write twice on a socket closed by the other end. */ signal(SIGPIPE, SIG_IGN); -- cgit v1.2.3 From 128fc752a45d51beb71c1aea4d5433efd00ac02a Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Mon, 14 Dec 2015 15:08:15 +0300 Subject: Don't wait for twice the delay_write timeout This happens only during processing ALIVE2 request. reply() already performs the same delay as in the deleted code. --- erts/epmd/src/epmd_srv.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'erts/epmd/src/epmd_srv.c') diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index 8c8d7304f2..5b58554590 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -700,9 +700,6 @@ static void do_request(g, fd, s, buf, bsize) put_int16(node->creation, wbuf+2); } - if (g->delay_write) /* Test of busy server */ - sleep(g->delay_write); - if (reply(g, fd, wbuf, 4) != 4) { dbg_tty_printf(g,1,"** failed to send ALIVE2_RESP for \"%s\"", -- cgit v1.2.3 From 8e6d005dcd8f62745d28d1820c4b2a5025634f5f Mon Sep 17 00:00:00 2001 From: Alexey Lebedeff Date: Mon, 14 Dec 2015 15:15:52 +0300 Subject: Prevent down nodes going undetected in epmd In the following (rare) case down node will be always registered in epmd: - client connects to epmd and sends ALIVE2 request - epmd reads this request and starts to process it - during that time client socket closes in such way that subsequent write(2) in epmd will result in error - at this point we have node that was registered in database, but as the connection struct has no 'keep' flag set, the do_read() closes connection and removes it from select fdset - and so there is no way for this node to be cleaned up later. We've seen several epmd instances in such state on our production systems. And while I'm not sure what was the exact sequence of events that leads to failed write(2), issue could be easily reproduced using SO_LINGER option for socket. --- erts/epmd/src/epmd_srv.c | 1 + 1 file changed, 1 insertion(+) (limited to 'erts/epmd/src/epmd_srv.c') diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index 8c8d7304f2..c9d49e73d0 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -705,6 +705,7 @@ static void do_request(g, fd, s, buf, bsize) if (reply(g, fd, wbuf, 4) != 4) { + node_unreg(g, name); dbg_tty_printf(g,1,"** failed to send ALIVE2_RESP for \"%s\"", name); return; -- cgit v1.2.3