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>
This commit is contained in:
parent
406aa9809c
commit
4756e27bbc
@ -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 "
|
||||
|
Loading…
x
Reference in New Issue
Block a user