summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-03-30 09:04:15 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-03-30 05:56:44 -0700
commit86fa9298ea9d04766c0a693192e6660ad4b02165 (patch)
tree5dca2dc3a812d876c32db965044847ac6923b54d /xlators/features/changelog
parent8907f67ba215172b01a7018adcbb063fcc4570e9 (diff)
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 <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10030 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/changelog')
-rw-r--r--xlators/features/changelog/src/changelog.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index bb9c51a..6c7a0a8 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;
}