diff options
author | Kinglong Mee <mijinlong@open-fs.com> | 2018-09-18 07:58:58 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-09-27 03:03:53 +0000 |
commit | 4756e27bbcd8ccc11180843ad23b833e8a5cf22c (patch) | |
tree | d9855f6c35cc8094354cfda32a79190fa8a6a76a /rpc/rpc-lib/src | |
parent | 406aa9809cf7e841f3f5e32fbab0097d4779dca3 (diff) |
rpc: failed requests immediately if rpc connection is down
In the case glfs_fini is ongoing, some cache xlators like readdir-ahead,
continues to submit requests. Current rpc submit code ignores
connection status and queues these internally generated requests. These
requests then got cleaned up after inode table has been destroyed,
causing crash.
Change-Id: Ife6b17d8592a054f7a7f310c79d07af005087017
updates: bz#1626313
Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
Diffstat (limited to 'rpc/rpc-lib/src')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index c5236251549..0a1bcd35d53 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1674,7 +1674,9 @@ rpc_clnt_submit(struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum, pthread_mutex_lock(&conn->lock); { - if (conn->connected == 0 && !rpc->disabled) { + if (conn->connected == 0) { + if (rpc->disabled) + goto nosubmit; ret = rpc_transport_connect(conn->trans, conn->config.remote_port); if (ret < 0) { gf_log(conn->name, GF_LOG_WARNING, @@ -1685,6 +1687,7 @@ rpc_clnt_submit(struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum, } ret = rpc_transport_submit_request(conn->trans, &req); + nosubmit: if (ret == -1) { gf_log(conn->name, GF_LOG_WARNING, "failed to submit rpc-request " |