diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-03-18 16:29:10 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-03-27 09:58:29 -0400 |
commit | 8ab106ab27c427acda2a040d9f81cb8b7d573921 (patch) | |
tree | 380ffe0543ce25bc58b8ea5d4be1031442364e98 /rpc | |
parent | a25ea72ce662122318778c49a9366a9afd4902dc (diff) |
rpc: bump up conn->cleanup_gen in rpc_clnt_reconnect_cleanup
Commit 086436a introduced generation number (cleanup_gen) to ensure that
rpc layer doesn't end up cleaning up the connection object if
application layer has already destroyed it. Bumping up cleanup_gen was
done only in rpc_clnt_connection_cleanup (). However the same is needed
in rpc_clnt_reconnect_cleanup () too as with out it if the object gets destroyed
through the reconnect event in the application layer, rpc layer will
still end up in trying to delete the object resulting into double free
and crash.
Peer probing an invalid host/IP was the basic test to catch this issue.
>Reviewed-on: https://review.gluster.org/16914
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>Reviewed-by: Milind Changire <mchangir@redhat.com>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
>(cherry picked from commit 39e09ad1e0e93f08153688c31433c38529f93716)
Change-Id: Id5332f3239cb324cead34eb51cf73d426733bd46
BUG: 1434399
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/16936
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 3284971b3e9..603e50d713b 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -494,8 +494,10 @@ rpc_clnt_reconnect_cleanup (rpc_clnt_connection_t *conn) if (conn->reconnect) { ret = gf_timer_call_cancel (clnt->ctx, conn->reconnect); - if (!ret) + if (!ret) { reconnect_unref = _gf_true; + conn->cleanup_gen++; + } conn->reconnect = NULL; } |