summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-clnt.h
diff options
context:
space:
mode:
authorRajesh Joseph <rjoseph@redhat.com>2016-12-03 01:10:51 +0530
committerRaghavendra Talur <rtalur@redhat.com>2016-12-20 09:12:25 -0800
commiteda85ee122a58231c9b82224cb154d2e394d284a (patch)
treeaff69ec94b302c4d6060ad47217825e632f92766 /rpc/rpc-lib/src/rpc-clnt.h
parente5e9de4bd7c0b9421de5095207a58b9372b1bd7d (diff)
rpc: fix for race between rpc and protocol/client
It is possible that the notification thread which notifies protocol/client layer about the disconnection is put to sleep and meanwhile, a fuse thread or a timer thread initiates and completes reconnection to the brick. The notification thread is then woken up and protocol/client layer updates its flags to indicate that network is disconnected. No reconnection is initiated because reconnection is rpc-lib layer's responsibility and its flags indicate that connection is connected. Fix: Serialize connect and disconnect notify > Credit: Raghavendra Talur <rtalur@redhat.com> > Reviewed-on: http://review.gluster.org/15916 > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Smoke: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra Talur <rtalur@redhat.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> (cherry picked from commit aa22f24f5db7659387704998ae01520708869873) Change-Id: I8ff5d1a3283b47f5c26848a42016a40bc34ffc1d BUG: 1401534 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/16025 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.h')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h
index f84b4cbf806..3a5b287cd49 100644
--- a/rpc/rpc-lib/src/rpc-clnt.h
+++ b/rpc/rpc-lib/src/rpc-clnt.h
@@ -172,6 +172,7 @@ struct rpc_req {
typedef struct rpc_clnt {
pthread_mutex_t lock;
+ pthread_mutex_t notifylock;
rpc_clnt_notify_t notifyfn;
rpc_clnt_connection_t conn;
void *mydata;