From 86fa9298ea9d04766c0a693192e6660ad4b02165 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Mon, 30 Mar 2015 09:04:15 +0200 Subject: changelog xlator: avoid unsupported threaded event-poll usage The changelog xlator was modified to use a poller thread, which uses the same event pool as the xlator stack. Unfortunately, such threaded usage of event pool is not supported by event-poll code, only event-epoll supports it. As a result, platforms such as NetBSD that lack epoll support got broken. The fix is to remove the poller thread, which does not cause any functionnality loss because the xlator stack event poll is functionnal. That lets NetBSD pass AFR tests again. BUG: 1129939 Change-Id: I3d73cf58e2ed8d92d9e0191f7abda3c37dea4159 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/10030 Reviewed-by: Krishnan Parthasarathi Reviewed-by: Venky Shankar Tested-by: Venky Shankar Tested-by: Gluster Build System --- xlators/features/changelog/src/changelog.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'xlators') diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c index bb9c51a2a0b..6c7a0a80f17 100644 --- a/xlators/features/changelog/src/changelog.c +++ b/xlators/features/changelog/src/changelog.c @@ -2489,7 +2489,8 @@ changelog_cleanup_rpc (xlator_t *this, changelog_priv_t *priv) rbuf_dtor (priv->rbuf); /* cleanup poller thread */ - (void) changelog_thread_cleanup (this, priv->poller); + if (priv->poller) + (void) changelog_thread_cleanup (this, priv->poller); } static int @@ -2504,13 +2505,6 @@ changelog_init_rpc (xlator_t *this, changelog_priv_t *priv) /* initialize event selection */ changelog_init_event_selection (this, selection); - ret = pthread_create (&priv->poller, NULL, changelog_rpc_poller, this); - if (ret != 0) { - gf_log (this->name, GF_LOG_ERROR, - "failed to spawn poller thread"); - goto error_return; - } - priv->rbuf = rbuf_init (NR_ROTT_BUFFS); if (!priv->rbuf) goto cleanup_thread; @@ -2526,8 +2520,9 @@ changelog_init_rpc (xlator_t *this, changelog_priv_t *priv) cleanup_rbuf: rbuf_dtor (priv->rbuf); cleanup_thread: - (void) changelog_thread_cleanup (this, priv->poller); - error_return: + if (priv->poller) + (void) changelog_thread_cleanup (this, priv->poller); + return -1; } -- cgit