From eae0d6908e9aab06332f95a05ffc3f0c9771aab1 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 11 Aug 2012 15:04:54 -0700 Subject: [PATCH] hammer2 - Implement automatic reconnect * Somehow the actual commit wound up in a merge e1648a68d2a340848f1c8ec7bd695c6285927392. * When the hammer2 service daemon starts it now scans all hammer2 mount points and attempts to reconnect itself to each one. This allows the sysop to kill the hammer2 service daemon, which will remote the machine's mounts from the cluster, and then later restart it to add the machine's mounts back into the cluster. * Fix a pthread detachment bug. Some pthreads are not tracked and have to detach themselves to avoid a libpthread memory leak. --- sbin/hammer2/cmd_service.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/sbin/hammer2/cmd_service.c b/sbin/hammer2/cmd_service.c index 7564773..2819b05 100644 --- a/sbin/hammer2/cmd_service.c +++ b/sbin/hammer2/cmd_service.c @@ -178,6 +178,10 @@ master_accept(void *data) * This procedure attempts to [re]connect to existing mounts when * the service daemon is started up before going into its accept * loop. + * + * NOTE: A hammer2 mount point can only accomodate one connection at a time + * so this will disconnect any existing connection during the + * reconnect. */ static void -- 1.7.7.2