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

Client does not go back to initial Wait Phase when offer service TTL expires #804

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions implementation/routing/src/routing_manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2698,6 +2698,8 @@ void routing_manager_impl::update_routing_info(std::chrono::milliseconds _elapse
for (const auto &i : s.second) {
if (discovery_) {
discovery_->unsubscribe_all(s.first, i);
// go to Initial Wait Phase
discovery_->reset_request_sent_counter(s.first, i);
}
del_routing_info(s.first, i, true, true);
VSOMEIP_INFO << "update_routing_info: elapsed=" << _elapsed.count()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class service_discovery {
eventgroup_t _eventgroup, client_t _client) = 0;
virtual void unsubscribe_all(service_t _service, instance_t _instance) = 0;
virtual void unsubscribe_all_on_suspend() = 0;
virtual void reset_request_sent_counter(service_t _service, instance_t _instance) = 0;

virtual bool send(bool _is_announcing) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class service_discovery_impl: public service_discovery,
void unsubscribe_all(service_t _service, instance_t _instance);
void unsubscribe_all_on_suspend();
void remove_subscriptions(service_t _service, instance_t _instance);
void reset_request_sent_counter(service_t _service, instance_t _instance);

bool send(bool _is_announcing);

Expand Down
12 changes: 12 additions & 0 deletions implementation/service_discovery/src/service_discovery_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ service_discovery_impl::release_service(
}
}

void
service_discovery_impl::reset_request_sent_counter(service_t _service, instance_t _instance) {
std::lock_guard<std::mutex> its_lock(requested_mutex_);
auto find_service = requested_.find(_service);
if (find_service != requested_.end()) {
auto find_instance = find_service->second.find(_instance);
if (find_instance != find_service->second.end()) {
find_instance->second->set_sent_counter(0);
}
}
}

void
service_discovery_impl::update_request(service_t _service, instance_t _instance) {
std::lock_guard<std::mutex> its_lock(requested_mutex_);
Expand Down
Loading