Do not update match counts on redundant unmatch
Dropping a match from a data reader generated unregisters and signalled a SUBSCRIPTION_MATCHED event even when another thread raced it and did so before. The consequence is possible undercounting of the number of matched writers. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
87398bdc98
commit
8ae5f706d0
1 changed files with 60 additions and 56 deletions
|
@ -1454,12 +1454,12 @@ static void reader_drop_connection (const struct nn_guid *rd_guid, const struct
|
|||
if ((m = ddsrt_avl_lookup (&rd_writers_treedef, &rd->writers, &pwr->e.guid)) != NULL)
|
||||
ddsrt_avl_delete (&rd_writers_treedef, &rd->writers, m);
|
||||
ddsrt_mutex_unlock (&rd->e.lock);
|
||||
free_rd_pwr_match (pwr->e.gv, m);
|
||||
|
||||
if (m != NULL)
|
||||
{
|
||||
if (rd->rhc)
|
||||
{
|
||||
struct proxy_writer_info pwr_info;
|
||||
make_proxy_writer_info(&pwr_info, &pwr->e, pwr->c.xqos);
|
||||
make_proxy_writer_info (&pwr_info, &pwr->e, pwr->c.xqos);
|
||||
rhc_unregister_wr (rd->rhc, &pwr_info);
|
||||
}
|
||||
if (rd->status_cb)
|
||||
|
@ -1476,6 +1476,8 @@ static void reader_drop_connection (const struct nn_guid *rd_guid, const struct
|
|||
(rd->status_cb) (rd->status_cb_entity, &data);
|
||||
}
|
||||
}
|
||||
free_rd_pwr_match (pwr->e.gv, m);
|
||||
}
|
||||
}
|
||||
|
||||
static void reader_drop_local_connection (const struct nn_guid *rd_guid, const struct writer *wr)
|
||||
|
@ -1488,8 +1490,8 @@ static void reader_drop_local_connection (const struct nn_guid *rd_guid, const s
|
|||
if ((m = ddsrt_avl_lookup (&rd_local_writers_treedef, &rd->local_writers, &wr->e.guid)) != NULL)
|
||||
ddsrt_avl_delete (&rd_local_writers_treedef, &rd->local_writers, m);
|
||||
ddsrt_mutex_unlock (&rd->e.lock);
|
||||
free_rd_wr_match (m);
|
||||
|
||||
if (m != NULL)
|
||||
{
|
||||
if (rd->rhc)
|
||||
{
|
||||
/* FIXME: */
|
||||
|
@ -1511,6 +1513,8 @@ static void reader_drop_local_connection (const struct nn_guid *rd_guid, const s
|
|||
(rd->status_cb) (rd->status_cb_entity, &data);
|
||||
}
|
||||
}
|
||||
free_rd_wr_match (m);
|
||||
}
|
||||
}
|
||||
|
||||
static void update_reader_init_acknack_count (const ddsrt_log_cfg_t *logcfg, const struct ephash *guid_hash, const struct nn_guid *rd_guid, nn_count_t count)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue