Skip to content

Commit b07f7b5

Browse files
committed
[Driver/C] Do not re-resolve control/endpoint addresses if the corresponding endpoint is not active.
In case of an endpoint being closed (e.g. publication is removed) all outstanding re-resolution requests should be ignored.
1 parent 79474e5 commit b07f7b5

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

aeron-driver/src/main/c/aeron_driver_conductor.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6176,6 +6176,12 @@ void aeron_driver_conductor_on_re_resolve_endpoint_complete(
61766176
aeron_async_re_resolve_t *async_cmd = task_clientd;
61776177
aeron_driver_conductor_t *conductor = executor_clientd;
61786178

6179+
aeron_send_channel_endpoint_t *endpoint = async_cmd->endpoint;
6180+
if (AERON_SEND_CHANNEL_ENDPOINT_STATUS_ACTIVE != endpoint->conductor_fields.status)
6181+
{
6182+
return;
6183+
}
6184+
61796185
if (result < 0)
61806186
{
61816187
aeron_driver_conductor_log_explicit_error(conductor, errcode, errmsg);
@@ -6201,8 +6207,8 @@ void aeron_driver_conductor_on_re_resolve_endpoint(void *clientd, void *item)
62016207
aeron_command_re_resolve_t *cmd = item;
62026208
struct sockaddr_storage resolved_addr;
62036209
memset(&resolved_addr, 0, sizeof(resolved_addr));
6204-
aeron_send_channel_endpoint_t *endpoint = cmd->endpoint;
62056210

6211+
aeron_send_channel_endpoint_t *endpoint = cmd->endpoint;
62066212
if (AERON_SEND_CHANNEL_ENDPOINT_STATUS_ACTIVE != endpoint->conductor_fields.status)
62076213
{
62086214
return;
@@ -6245,6 +6251,12 @@ void aeron_driver_conductor_on_re_resolve_control_complete(
62456251
aeron_async_re_resolve_t *async_cmd = task_clientd;
62466252
aeron_driver_conductor_t *conductor = executor_clientd;
62476253

6254+
aeron_receive_channel_endpoint_t *endpoint = async_cmd->endpoint;
6255+
if (AERON_RECEIVE_CHANNEL_ENDPOINT_STATUS_ACTIVE != endpoint->conductor_fields.status)
6256+
{
6257+
return;
6258+
}
6259+
62486260
if (result < 0)
62496261
{
62506262
aeron_driver_conductor_log_explicit_error(conductor, errcode, errmsg);
@@ -6272,8 +6284,13 @@ void aeron_driver_conductor_on_re_resolve_control(void *clientd, void *item)
62726284
struct sockaddr_storage resolved_addr;
62736285
memset(&resolved_addr, 0, sizeof(resolved_addr));
62746286

6275-
aeron_async_re_resolve_t *async_cmd;
6287+
aeron_receive_channel_endpoint_t *endpoint = cmd->endpoint;
6288+
if (AERON_RECEIVE_CHANNEL_ENDPOINT_STATUS_ACTIVE != endpoint->conductor_fields.status)
6289+
{
6290+
return;
6291+
}
62766292

6293+
aeron_async_re_resolve_t *async_cmd;
62776294
if (aeron_alloc((void **)&async_cmd, sizeof(aeron_async_re_resolve_t)) < 0)
62786295
{
62796296
AERON_APPEND_ERR("%s", "");

0 commit comments

Comments
 (0)