diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-10 07:18:10 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-13 22:10:27 -0700 |
commit | e73e7afe5630894faa7a2829969cd16ea99e3c71 (patch) | |
tree | 7f727355164e4acf51c54423203aefdc49848ad1 /libglusterfsclient/src/libglusterfsclient.c | |
parent | 31f0f48130fb68908413e710d960c5d7c6476b45 (diff) |
libglusterfsclient: Wait for time ample enough for all the children of distribute to initialize before sending lookup on '/'.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 255 (libglusterfsclient should wait till all the children of distribute are initialized before sending first lookup on '/')
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=255
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 23379ecff7a..bba5877897e 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -51,6 +51,7 @@ #include <stdarg.h> #include <sys/statvfs.h> #include "hashfn.h" +#include <sys/select.h> #define LIBGF_XL_NAME "libglusterfsclient" #define LIBGLUSTERFS_INODE_TABLE_LRU_LIMIT 1000 //14057 @@ -1034,6 +1035,7 @@ glusterfs_init (glusterfs_init_params_t *init_ctx, uint32_t fakefsid) struct rlimit lim; uint32_t xl_count = 0; loc_t new_loc = {0, }; + struct timeval tv = {0, }; if (!init_ctx || (!init_ctx->specfile && !init_ctx->specfp)) { errno = EINVAL; @@ -1335,6 +1337,15 @@ glusterfs_init (glusterfs_init_params_t *init_ctx, uint32_t fakefsid) } pthread_mutex_unlock (&priv->lock); + /* + * wait for some time to allow initialization of all children of + * distribute before sending lookup on '/' + */ + + tv.tv_sec = 0; + tv.tv_usec = (100 * 1000); + select (0, NULL, NULL, NULL, &tv); + /* workaround for xlators like dht which require lookup to be sent * on / */ libgf_client_loc_fill (&new_loc, ctx, 1, 0, "/"); |