summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.c
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2019-07-26 12:34:52 +0800
committerhari gowtham <hari.gowtham005@gmail.com>2019-08-28 08:34:45 +0000
commitf7d1fa51cf7308a6d68ed9fa1e8cc4a7c66ad121 (patch)
treea0e119d85908bc13aa39377674d6dec7004b97c6 /xlators/protocol/server/src/server.c
parent2c46789ad04500b1e31585c6d51cd925d2ad895d (diff)
event: rename event_XXX with gf_ prefixed
I hit one crash issue when using the libgfapi. In the libgfapi it will call glfs_poller() --> event_dispatch() in file api/src/glfs.c:721, and the event_dispatch() is defined by libgluster locally, the problem is the name of event_dispatch() is the extremly the same with the one from libevent package form the OS. For example, if a executable program Foo, which will also use and link the libevent and the libgfapi at the same time, I can hit the crash, like: kernel: glfs_glfspoll[68486]: segfault at 1c0 ip 00007fef006fd2b8 sp 00007feeeaffce30 error 4 in libevent-2.0.so.5.1.9[7fef006ed000+46000] The link for Foo is: lib_foo_LADD = -levent $(GFAPI_LIBS) It will crash. This is because the glfs_poller() is calling the event_dispatch() from the libevent, not the libglsuter. The gfapi link info : GFAPI_LIBS = -lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid If I link Foo like: lib_foo_LADD = $(GFAPI_LIBS) -levent It will works well without any problem. And if Foo call one private lib, such as handler_glfs.so, and the handler_glfs.so will link the GFAPI_LIBS directly, while the Foo won't and it will dlopen(handler_glfs.so), then the crash will be hit everytime. The link info will be: foo_LADD = -levent libhandler_glfs_LIBADD = $(GFAPI_LIBS) I can avoid the crash temporarily by linking the GFAPI_LIBS in Foo too like: foo_LADD = $(GFAPI_LIBS) -levent libhandler_glfs_LIBADD = $(GFAPI_LIBS) But this is ugly since the Foo won't use any APIs from the GFAPI_LIBS. And in some cases when the --as-needed link option is added(on many dists it is added as default), then the crash is back again, the above workaround won't work. Backport of: > https://review.gluster.org/#/c/glusterfs/+/23110/ > Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa > Fixes: #699 > Signed-off-by: Xiubo Li <xiubli@redhat.com> Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa updates: bz#1740525 Signed-off-by: Xiubo Li <xiubli@redhat.com> (cherry picked from commit 799edc73c3d4f694c365c6a7c27c9ab8eed5f260)
Diffstat (limited to 'xlators/protocol/server/src/server.c')
-rw-r--r--xlators/protocol/server/src/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index c90217e2f03..67122c03556 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -697,7 +697,7 @@ server_check_event_threads(xlator_t *this, server_conf_t *conf, int32_t new)
return 0;
}
- return event_reconfigure_threads(pool, target);
+ return gf_event_reconfigure_threads(pool, target);
}
int
@@ -1002,7 +1002,7 @@ server_cleanup(xlator_t *this, server_conf_t *conf)
if (this->ctx->event_pool) {
/* Free the event pool */
- (void)event_pool_destroy(this->ctx->event_pool);
+ (void)gf_event_pool_destroy(this->ctx->event_pool);
}
if (dict_get(this->options, "config-directory")) {