summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-03-02 15:47:37 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-03-03 11:58:03 +0530
commit5ed5ea9bffe018512edc6babff18fd4d44bcdd70 (patch)
tree6520121a74b98cb51076453a6945ee2a692e6598
parent130ae0dee7f1ed1292c32df52276833a9fa187b2 (diff)
create fuse thread after setvolume cbk happens, not only in case of success
This patch fixes the 'hang' effect when client protocol fails to authenticate to servers (it may be problem with volume file, or server process would have not started yet). Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c32
-rw-r--r--xlators/protocol/client/src/client-protocol.c27
2 files changed, 23 insertions, 36 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 6cdba9ea..d6dbf760 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -2630,27 +2630,8 @@ notify (xlator_t *this, int32_t event,
switch (event)
{
case GF_EVENT_CHILD_UP:
-
-#ifndef GF_DARWIN_HOST_OS
- /*
- * This is because macfuse sends statfs() once the fuse thread
- * gets activated, and by that time if the client is not
- * connected, it give 'Device not configured' error. Hence,
- * create thread only when client sends CHILD_UP (ie, client
- * is connected).
- */
-
- /* TODO: somehow, try to get the mountpoint active as soon as
- * init() is complete, so that the hang effect when the
- * server is not not started is removed.
- */
-
- /* This code causes problem with 'automount' too */
- /* case GF_EVENT_CHILD_CONNECTING: */
-#endif /* DARWIN */
-
+ case GF_EVENT_CHILD_CONNECTING:
{
-
if (!private->fuse_thread_started)
{
private->fuse_thread_started = 1;
@@ -2658,10 +2639,15 @@ notify (xlator_t *this, int32_t event,
ret = pthread_create (&private->fuse_thread, NULL,
fuse_thread_proc, this);
- if (ret != 0)
+ if (ret != 0) {
gf_log ("glusterfs-fuse", GF_LOG_ERROR,
- "pthread_create() failed (%s)", strerror (errno));
- assert (ret == 0);
+ "pthread_create() failed (%s)",
+ strerror (errno));
+
+ /* If fuse thread is not started, that means,
+ its hung, we can't use this process. */
+ raise (SIGTERM);
+ }
}
break;
}
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index 11e66983..5212d67c 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -5956,6 +5956,20 @@ client_setvolume_cbk (call_frame_t *frame,
}
out:
+ if (-1 == op_ret) {
+ /* Let the connection/re-connection happen in
+ * background, for now, don't hang here,
+ * tell the parents that i am all ok..
+ */
+ parent = trans->xl->parents;
+ while (parent) {
+ parent->xlator->notify (parent->xlator,
+ GF_EVENT_CHILD_CONNECTING,
+ trans->xl);
+ parent = parent->next;
+ }
+ }
+
STACK_DESTROY (frame->root);
if (reply)
@@ -6608,7 +6622,6 @@ notify (xlator_t *this,
case GF_EVENT_PARENT_UP:
{
- xlator_list_t *parent = NULL;
client_conf_t *conf = NULL;
int i = 0;
transport_t *trans = NULL;
@@ -6630,18 +6643,6 @@ notify (xlator_t *this,
client_protocol_reconnect (trans);
}
-
- /* Let the connection/re-connection happen in
- * background, for now, don't hang here,
- * tell the parents that i am all ok..
- */
- parent = trans->xl->parents;
- while (parent) {
- parent->xlator->notify (parent->xlator,
- GF_EVENT_CHILD_CONNECTING,
- trans->xl);
- parent = parent->next;
- }
}
break;