diff options
| author | Soumya Koduri <skoduri@redhat.com> | 2015-08-06 06:22:38 +0530 | 
|---|---|---|
| committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-08-19 04:10:57 -0700 | 
| commit | 4ec99ad55f2ad74d67591cda68320c26235a9e12 (patch) | |
| tree | ce56371e3000117aa2ba2d389ec47977fe3c6c1b | |
| parent | 5d9668dbb4f20ec7ce385e1d348e46b1425e4e84 (diff) | |
rpc-clnt: Check for transport object during rpc connection cleanup
While doing glfs_fini(), all the xlators are first notified of
PARENT_DOWN. protocol-client xlator on receving that notification
does rpc_clnt_disable which disassociates rpc->conn with its
transport object and does socket shutdown. So any further references
to conn->trans should not happen during rpc connection cleanup which
is done mainly as part of epoll event handling of EPOLLERR/EPOLLHUP.
This is a backport of the below fix-
 http://review.gluster.org/#/c/11845/
BUG: 1254607
Change-Id: I619ec00fd061f77c9b04dfa6fd139620cb44189b
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/11845
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/11953
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
| -rw-r--r-- | rpc/rpc-lib/src/rpc-clnt-ping.c | 10 | 
1 files changed, 7 insertions, 3 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.c b/rpc/rpc-lib/src/rpc-clnt-ping.c index 17f8874a6a4..77f3e32001c 100644 --- a/rpc/rpc-lib/src/rpc-clnt-ping.c +++ b/rpc/rpc-lib/src/rpc-clnt-ping.c @@ -89,9 +89,13 @@ __rpc_clnt_remove_ping_timer (struct rpc_clnt *rpc)                  return 1;          } -        gf_log_callingfn ("", GF_LOG_DEBUG, "%s: ping timer event " -                          "already removed", -                           conn->trans->peerinfo.identifier); + +        /* This is to account for rpc_clnt_disable that might have set +         *  conn->trans to NULL. */ +        if (conn->trans) +                gf_log_callingfn ("", GF_LOG_DEBUG, "%s: ping timer event " +                                  "already removed", +                                   conn->trans->peerinfo.identifier);          return 0;  }  | 
