Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2010 12:12:10 +0300
From:      Mikolaj Golub <to.my.trociny@gmail.com>
To:        freebsd-fs@FreeBSD.org
Subject:   hastd: socket leakage on worker exit
Message-ID:  <86pr265p5h.fsf@kopusha.onet>

next in thread | raw e-mail | index | archive | help
--=-=-=

Hi,

Playing with HAST I have noticed the following issue with hasd:

....
Apr 10 22:32:36 hastb hastd: [storage] (secondary) Split-brain detected, exiting.
Apr 10 22:32:36 hastb hastd: [storage] (secondary) Worker process failed (pid=6474, status=78).
Apr 10 22:32:56 hastb hastd: [storage] (secondary) Split-brain detected, exiting.
Apr 10 22:32:56 hastb hastd: [storage] (secondary) Worker process failed (pid=6475, status=78).
Apr 10 22:32:56 hastb hastd: [storage] (secondary) Unable to create control sockets be: Too many open files

And sockstat:

root     hastd      711   4  stream /var/run/hastctl
root     hastd      711   5  tcp4   *:8457                *:*
root     hastd      711   7  dgram  -> /var/run/logpriv
root     hastd      711   8  stream (not connected)
root     hastd      711   9  stream -> ??
root     hastd      711   10 stream -> ??
root     hastd      711   12 stream -> ??
root     hastd      711   13 stream -> ??
root     hastd      711   14 stream -> ??
root     hastd      711   15 stream -> ??
[ ... and so on .. ]

The patch below has fixed the issue.

-- 
Mikolaj Golub


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=hastd.c.close_on_child_exit.patch

--- sbin/hastd/hastd.c.orig	2010-04-11 11:52:10.000000000 +0300
+++ sbin/hastd/hastd.c	2010-04-11 11:51:23.000000000 +0300
@@ -138,6 +138,7 @@ child_exit(void)
 			    (unsigned int)pid, WEXITSTATUS(status));
 		}
 		res->hr_workerpid = 0;
+		proto_close(res->hr_ctrl);
 		if (res->hr_role == HAST_ROLE_PRIMARY) {
 			sleep(1);
 			pjdlog_info("Restarting worker process.");

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86pr265p5h.fsf>