From 5632ed46b53be920ed5c7d27872612368c7e6e10 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Wed, 15 Jan 2020 12:47:44 +0100 Subject: [PATCH] Register manual-by-topic lease in transition to alive Lease handling removes expired leases from the heap, and so a proxy writer that transitions from not-alive to alive needs to re-schedule expiry again or it will remain alive forever after having regained liveliness once. This was missing for a manual-by-topic lease. Signed-off-by: Erik Boasson --- src/core/ddsi/src/q_entity.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/ddsi/src/q_entity.c b/src/core/ddsi/src/q_entity.c index 5510835..abc9976 100644 --- a/src/core/ddsi/src/q_entity.c +++ b/src/core/ddsi/src/q_entity.c @@ -4478,8 +4478,13 @@ void proxy_writer_set_alive_may_unlock (struct proxy_writer *pwr, bool notify) ddsrt_mutex_lock (&pwr->c.proxypp->e.lock); pwr->alive = true; pwr->alive_vclock++; - if (pwr->c.xqos->liveliness.lease_duration != T_NEVER && pwr->c.xqos->liveliness.kind != DDS_LIVELINESS_MANUAL_BY_TOPIC) - proxy_participant_add_pwr_lease_locked (pwr->c.proxypp, pwr); + if (pwr->c.xqos->liveliness.lease_duration != T_NEVER) + { + if (pwr->c.xqos->liveliness.kind != DDS_LIVELINESS_MANUAL_BY_TOPIC) + proxy_participant_add_pwr_lease_locked (pwr->c.proxypp, pwr); + else + lease_set_expiry (pwr->lease, add_duration_to_etime (now_et (), pwr->lease->tdur)); + } ddsrt_mutex_unlock (&pwr->c.proxypp->e.lock); if (notify)