summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-05-03 12:17:30 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-05-10 14:06:14 +0000
commit25e24c5ab7202d43afa837cf5159e14fe078cc73 (patch)
treea5171de97a4978e0d120bb9ddcefa79a56157507 /glusterfsd/src
parent7287b46042f805d646d7e117c243a1a4fdc61788 (diff)
glusterd: cleanup pidfile on pmap signout
This patch ensures 1. brick pidfile is cleaned up on pmap signout 2. pmap signout evemt is sent for all the bricks when a brick process shuts down. >Reviewed-on: https://review.gluster.org/17168 >Smoke: Gluster Build System <jenkins@build.gluster.org> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> >(cherry picked from commit 3d35e21ffb15713237116d85711e9cd1dda1688a) Change-Id: I7606a60775b484651d4b9743b6037b40323931a2 BUG: 1449004 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17211 Reviewed-by: Prashanth Pai <ppai@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'glusterfsd/src')
-rw-r--r--glusterfsd/src/glusterfsd.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index ec83434494e..cb92cbee867 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1303,6 +1303,9 @@ cleanup_and_exit (int signum)
{
glusterfs_ctx_t *ctx = NULL;
xlator_t *trav = NULL;
+ xlator_t *top;
+ xlator_t *victim;
+ xlator_list_t **trav_p;
ctx = glusterfsd_ctx;
@@ -1332,7 +1335,20 @@ cleanup_and_exit (int signum)
return;
ctx->cleanup_started = 1;
- glusterfs_mgmt_pmap_signout (ctx, NULL);
+
+ /* signout should be sent to all the bricks in case brick mux is enabled
+ * and multiple brick instances are attached to this process
+ */
+ if (ctx->active) {
+ top = ctx->active->first;
+ for (trav_p = &top->children; *trav_p;
+ trav_p = &(*trav_p)->next) {
+ victim = (*trav_p)->xlator;
+ glusterfs_mgmt_pmap_signout (ctx, victim->name);
+ }
+ } else {
+ glusterfs_mgmt_pmap_signout (ctx, NULL);
+ }
/* below part is a racy code where the rpcsvc object is freed.
* But in another thread (epoll thread), upon poll error in the