Skip to content

Commit 8b3c5a0

Browse files
danielsantiagoduartenfonseca
authored andcommitted
Enable subscription expiration
Summary Allow subscriptions to expire when a reboot or ttl timeout is detected Details set_noned() function created in remote_subscription.cpp added set_noned() at the end of routing_manager_impl::on_remote_subscribe to reset the set_forwarded to allow subscriptions to expire in case of reboot and ttl timeout.
1 parent 93b7757 commit 8b3c5a0

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

implementation/routing/include/remote_subscription.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class remote_subscription {
9999
void set_expired();
100100
bool is_forwarded() const;
101101
void set_forwarded();
102+
void clear_destiny();
102103

103104
private:
104105
std::atomic<remote_subscription_id_t> id_;

implementation/routing/src/remote_subscription.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,8 @@ void remote_subscription::set_forwarded() {
357357
this->final_destination_.store(destiny::forward, std::memory_order_release);
358358
}
359359

360+
void remote_subscription::clear_destiny() {
361+
this->final_destination_.store(destiny::none, std::memory_order_release);
362+
}
363+
360364
} // namespace vsomeip_v3

implementation/routing/src/routing_manager_impl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,6 +2991,7 @@ void routing_manager_impl::on_remote_subscribe(
29912991

29922992
its_update_lock.unlock();
29932993
_callback(_subscription);
2994+
_subscription->clear_destiny();
29942995
return;
29952996
}
29962997

@@ -3003,6 +3004,7 @@ void routing_manager_impl::on_remote_subscribe(
30033004
its_service, its_instance, its_eventgroup, its_major,
30043005
_subscription->get_clients(), its_id);
30053006
}
3007+
_subscription->clear_destiny();
30063008
}
30073009

30083010
void routing_manager_impl::on_remote_unsubscribe(

0 commit comments

Comments
 (0)