diff options
author | Mohit Agrawal <moagrawal@redhat.com> | 2020-03-12 21:12:13 +0530 |
---|---|---|
committer | gluster-ant <bugzilla-bot@gluster.org> | 2020-03-12 21:12:13 +0530 |
commit | 92294ea0e622a204da201490acc3de210b4f0555 (patch) | |
tree | cd61da00b382c7b805e74d5e9370e11df2718f49 /rpc | |
parent | 75e1c20d60ec661eb7b0a6c6b16b24519b9f6a4e (diff) | |
download | glusterfs-92294ea0e622a204da201490acc3de210b4f0555.tar.gz glusterfs-92294ea0e622a204da201490acc3de210b4f0555.tar.xz glusterfs-92294ea0e622a204da201490acc3de210b4f0555.zip |
Posix: Use simple approach to close fd
Problem: posix_release(dir) functions add the fd's into a ctx->janitor_fds
and janitor thread closes the fd's.In brick_mux environment it is
difficult to handle race condition in janitor threads because brick
spawns a single janitor thread for all bricks.
Solution: Use synctask to execute posix_release(dir) functions instead of
using background a thread to close fds.
Credits: Pranith Karampuri <pkarampu@redhat.com>
Change-Id: Iffb031f0695a7da83d5a2f6bac8863dad225317e
Fixes: bz#1811631
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 81d40c8ec0..f7d911bf1c 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -365,6 +365,12 @@ rpcsvc_program_actor(rpcsvc_request_t *req) req->ownthread = program->ownthread; req->synctask = program->synctask; + if (((req->procnum == GFS3_OP_RELEASE) || + (req->procnum == GFS3_OP_RELEASEDIR)) && + (program->prognum == GLUSTER_FOP_PROGRAM)) { + req->ownthread = _gf_false; + req->synctask = _gf_true; + } err = SUCCESS; gf_log(GF_RPCSVC, GF_LOG_TRACE, "Actor found: %s - %s for %s", |