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

Fix timed-event lockup on pre-emptive ACKNACKs #1887

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions src/core/ddsi/src/ddsi_acknack.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,20 +505,15 @@ static struct ddsi_xmsg *make_and_resched_acknack (struct ddsi_xevent *ev, struc

static dds_duration_t preemptive_acknack_interval (const struct ddsi_pwr_rd_match *rwn)
{
if (rwn->t_last_ack.v < rwn->tcreate.v)
return 0;
const dds_duration_t age = rwn->t_last_ack.v - rwn->tcreate.v;
if (age <= DDS_SECS (10))
return DDS_SECS (1);
else if (age <= DDS_SECS (60))
return DDS_SECS (2);
else if (age <= DDS_SECS (120))
return DDS_SECS (5);
else
{
const dds_duration_t age = rwn->t_last_ack.v - rwn->tcreate.v;
if (age <= DDS_SECS (10))
return DDS_SECS (1);
else if (age <= DDS_SECS (60))
return DDS_SECS (2);
else if (age <= DDS_SECS (120))
return DDS_SECS (5);
else
return DDS_SECS (10);
}
return DDS_SECS (10);
}

static struct ddsi_xmsg *make_preemptive_acknack (struct ddsi_xevent *ev, struct ddsi_proxy_writer *pwr, struct ddsi_pwr_rd_match *rwn, ddsrt_mtime_t tnow)
Expand Down
2 changes: 1 addition & 1 deletion src/core/ddsi/src/ddsi_endpoint_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ void ddsi_proxy_writer_add_connection (struct ddsi_proxy_writer *pwr, struct dds
ELOGDISC (pwr, " ddsi_proxy_writer_add_connection(pwr "PGUIDFMT" rd "PGUIDFMT")",
PGUID (pwr->e.guid), PGUID (rd->e.guid));
m->rd_guid = rd->e.guid;
m->tcreate = ddsrt_time_monotonic ();
m->tcreate = tnow;

/* We track the last heartbeat count value per reader--proxy-writer
pair, so that we can correctly handle directed heartbeats. The
Expand Down