Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DISPATCH-1276 - Added a cleanup function qdrc_address_endpoint_cleanu… #463

Closed
wants to merge 5 commits into from

Conversation

Projects
None yet
2 participants
@ganeshmurthy
Copy link
Contributor

commented Mar 14, 2019

…p which will clean out the link's edge context in addition to cleaning out other state. This will prevent the crash outlined in the issue

DISPATCH-1276 - Added a cleanup function qdrc_address_endpoint_cleanu…
…p which will clean out the link's edge context in addition to cleaning out other state. This will prevent the crash outlined in the issue
endpoint_state->conn = qdrc_endpoint_get_connection_CT(endpoint);

endpoint_state->endpoint = endpoint;
endpoint_state->ref_count = 1;

This comment has been minimized.

Copy link
@ted-ross

ted-ross Mar 14, 2019

Member

Why is the ref_count initialized to 1? To which reference does this refer?

qdr_addr_tracking_module_context_t *mc = endpoint_state->mc;
assert (endpoint_state->conn);
endpoint_state->closed = true;
if (endpoint_state->ref_count == 1) {

This comment has been minimized.

Copy link
@ted-ross

ted-ross Mar 14, 2019

Member

I'm unclear as to why the state is freed when the ref_count is still 1.

@@ -329,10 +344,18 @@ static void on_link_event(void *context, qdrc_event_t event, qdr_link_t *link)
{
if (link->edge_context) {
qdr_addr_endpoint_state_t *endpoint_state = (qdr_addr_endpoint_state_t *)link->edge_context;
endpoint_state->link = 0;
endpoint_state->ref_count++;

This comment has been minimized.

Copy link
@ted-ross

ted-ross Mar 14, 2019

Member

Shouldn't this decrement the ref_count?

@@ -31,7 +31,8 @@ struct qdr_addr_endpoint_state_t {
qdrc_endpoint_t *endpoint;
qdr_connection_t *conn; // The connection associated with the endpoint.
qdr_addr_tracking_module_context_t *mc;
qdr_link_t *link;

This comment has been minimized.

Copy link
@ted-ross

ted-ross Mar 14, 2019

Member

Was this link pointer never used?

This comment has been minimized.

Copy link
@ganeshmurthy

ganeshmurthy Mar 14, 2019

Author Contributor

This link pointer was used but I realized my stupidity and removed it.

ganeshmurthy added some commits Mar 14, 2019

DISPATCH-1276 - Ref count fixes so that the endpoint state is not fre…
…ed when all the links that reference this state are freed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.