diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-05-28 14:23:49 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-06-18 21:53:08 -0700 |
commit | b3f480a8e451ff1b11761c4cfca6b798c35bfb04 (patch) | |
tree | 6146ab9d33523853ad60c1dfd3083438d824966a /xlators/mgmt | |
parent | 7f52e08e1b09315bd4c167187b60859516d41897 (diff) |
rpc: Cleanup rpc object in TRANSPORT_CLEANUP event
Backport of http://review.gluster.org/5107 (upstream)
This is to ensure that unref of rpc_clnt object doesn't race with the
unref of the corresponding rpc_transport object.
rpc_transport has ref_count 2, in normal scheme of things. One held by
the socket layer and the other held by rpc layer. This inequality in
ref_count between rpc_clnt and rpc_transport could lead to concurrent
destruction of the objects and possibly lead to a crash. To avoid this,
we defer the clean up of rpc_clnt obj to TRANSPORT_CLEANUP event. ie,
once rpc_transport's ref_count goes to zero.
Introduced rpc_clnt_disabled, to allow higher layers to differentiate
between the 'final'[1] disconnect, triggered from upper layers, and disconnect
seen as a consequence of transport disconnect. This differentiation
helps in cleaning up resources, at higher layers, in a race-free manner.
[1] - 'final' here means that the rpc and the associated connection, is not
to be used anymore. eg - glusterd_brick_disconnect on volume-stop.
Change-Id: I2ecf891a36e3b02cd9eacca964e659525d1bbc6e
BUG: 962619
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/5213
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt')
0 files changed, 0 insertions, 0 deletions