ganeshmurthy commented on a change in pull request #1310:
URL: https://github.com/apache/qpid-dispatch/pull/1310#discussion_r674804685
##########
File path: src/server.c
##########
@@ -1352,9 +1352,12 @@ static void try_open_cb(void *context)
// else deleted or failed - on failed wait until after connection is
freed
// and state is set to CXTR_STATE_CONNECTING (timer is rescheduled
then)
try_open_lh(ct, ctx);
+ ctx = 0; // owned by ct
}
sys_mutex_unlock(ct->lock);
+
+ free_qd_connection_t(ctx); // noop if ctx == 0
Review comment:
My comment is not about this fix but about the readability of this code.
A previous commit moved the creation of qd_connection_t from inside of
try_open_lh() to try_open_cb() and this is to avoid the lock issues caused by
the connector-entity cache lock inversion. From my point of view the previous
code was super easy to understand. This code is not. Instead of getting rid of
the entity cache concept completely, we are keeping it and making the code much
less readable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]