diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-10 05:53:59 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-10 06:13:57 -0700 |
commit | 5bec5e4fd6b0cae5e7a5e4d0a72090f4d613b94e (patch) | |
tree | d59d335fa51f224e9f02dc8779816cd60f043d91 /glusterfsd/src/glusterfsd-mgmt.c | |
parent | 4aada05a7a2b21d4c5275812a6e8f838e3a10512 (diff) |
glusterfsd: exit process instead of starting fuse in case of failures
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1586 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1586
Diffstat (limited to 'glusterfsd/src/glusterfsd-mgmt.c')
-rw-r--r-- | glusterfsd/src/glusterfsd-mgmt.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index a4a7422cfcf..c674533e492 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -38,6 +38,8 @@ #include "glusterfs3.h" #include "portmap.h" +#include "glusterfsd.h" + static char is_mgmt_rpc_reconnect; typedef ssize_t (*mgmt_serialize_t) (struct iovec outmsg, void *args); @@ -224,11 +226,14 @@ out: if (rsp.spec) free (rsp.spec); - if (ret && ctx && ctx->master) { - /* Failed to get the volume file, start fuse anyways */ - xlator_notify (ctx->master, - GF_EVENT_CHILD_CONNECTING, NULL); - + if (ret && ctx && !ctx->active) { + /* Do it only for the first time */ + /* Failed to get the volume file, something wrong, + restart the process */ + gf_log ("mgmt", GF_LOG_ERROR, + "failed to fetch volume file (key:%s)", + ctx->cmd_args.volfile_id); + cleanup_and_exit (0); } return 0; } @@ -272,24 +277,19 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, rpc_clnt_set_connected (ctx->mgmt); ret = glusterfs_volfile_fetch (ctx); - if (ret && ctx && ctx->master) { - /* Failed to get the volume file, start fuse anyways */ - xlator_notify (ctx->master, - GF_EVENT_CHILD_CONNECTING, NULL); - - gf_log ("", GF_LOG_WARNING, - "failed to fetch volume file"); + if (ret && ctx && (ctx->active == NULL)) { + /* Do it only for the first time */ + /* Exit the process.. there is some wrong options */ + gf_log ("mgmt", GF_LOG_ERROR, + "failed to fetch volume file (key:%s)", + ctx->cmd_args.volfile_id); + cleanup_and_exit (0); } if (is_mgmt_rpc_reconnect) glusterfs_mgmt_pmap_signin (ctx); break; default: - if (ctx->master) - ret = xlator_notify (ctx->master, - GF_EVENT_CHILD_CONNECTING, NULL); - gf_log ("", GF_LOG_WARNING, - "failed to establish mgmt rpc connection (%d)", ret); break; } |