diff options
author | Juergen Gehring <juergen.gehring@bmw.de> | 2018-05-22 02:56:41 -0700 |
---|---|---|
committer | Juergen Gehring <juergen.gehring@bmw.de> | 2018-05-22 02:56:41 -0700 |
commit | 3aec01c41c77f4b6f36134273f50cfb23ab87afb (patch) | |
tree | 5c714f0179516c464811a7a4b94fbdc383c4764c | |
parent | 2f0fdc596d24621c2bd4223cc63c8c1fb5b4c2d8 (diff) | |
download | vSomeIP-2.10.12.tar.gz |
vsomeip 2.10.122.10.12
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | implementation/logging/src/logger_impl.cpp | 3 | ||||
-rw-r--r-- | implementation/routing/include/routing_manager_stub.hpp | 4 | ||||
-rw-r--r-- | implementation/routing/src/routing_manager_impl.cpp | 56 | ||||
-rw-r--r-- | implementation/routing/src/routing_manager_proxy.cpp | 2 | ||||
-rw-r--r-- | implementation/routing/src/routing_manager_stub.cpp | 10 | ||||
-rw-r--r-- | implementation/runtime/src/application_impl.cpp | 14 | ||||
-rw-r--r-- | implementation/service_discovery/include/service_discovery.hpp | 3 | ||||
-rw-r--r-- | implementation/service_discovery/include/service_discovery_impl.hpp | 2 | ||||
-rw-r--r-- | implementation/service_discovery/src/service_discovery_impl.cpp | 6 |
11 files changed, 84 insertions, 21 deletions
@@ -1,6 +1,9 @@ Changes ======= +v2.10.12 +- Fix exception handling for boost logger + v2.10.11 - Fix client ID handling for remote selective subscriptions - Add handling for EDESTADDRREQ in endpoints diff --git a/CMakeLists.txt b/CMakeLists.txt index 2542e61..3d327d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ project (vsomeip) set (VSOMEIP_MAJOR_VERSION 2) set (VSOMEIP_MINOR_VERSION 10) -set (VSOMEIP_PATCH_VERSION 11) +set (VSOMEIP_PATCH_VERSION 12) set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION}) set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentatin/doxygen.in set (CMAKE_VERBOSE_MAKEFILE off) diff --git a/implementation/logging/src/logger_impl.cpp b/implementation/logging/src/logger_impl.cpp index d1db6b2..023dccf 100644 --- a/implementation/logging/src/logger_impl.cpp +++ b/implementation/logging/src/logger_impl.cpp @@ -12,6 +12,7 @@ #include <boost/log/utility/setup/console.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
+#include <boost/log/utility/exception_handler.hpp>
#include <boost/phoenix/bind/bind_member_function.hpp>
#include <boost/shared_ptr.hpp>
@@ -65,7 +66,7 @@ logger_impl::get_internal() { void logger_impl::init(const std::shared_ptr<configuration> &_configuration) {
get()->loglevel_ = _configuration->get_loglevel();
-
+ logging::core::get()->set_exception_handler(boost::log::make_exception_suppressor());
logging::core::get()->set_filter(
logging::trivial::severity >= get()->loglevel_);
diff --git a/implementation/routing/include/routing_manager_stub.hpp b/implementation/routing/include/routing_manager_stub.hpp index 3e97a5f..f97aab5 100644 --- a/implementation/routing/include/routing_manager_stub.hpp +++ b/implementation/routing/include/routing_manager_stub.hpp @@ -58,12 +58,12 @@ public: void on_stop_offer_service(client_t _client, service_t _service, instance_t _instance, major_version_t _major, minor_version_t _minor); - void send_subscribe(std::shared_ptr<vsomeip::endpoint> _target, + bool send_subscribe(std::shared_ptr<vsomeip::endpoint> _target, client_t _client, service_t _service, instance_t _instance, eventgroup_t _eventgroup, major_version_t _major, event_t _event, pending_subscription_id_t _subscription_id); - void send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target, + bool send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target, client_t _client, service_t _service, instance_t _instance, eventgroup_t _eventgroup, event_t _event, pending_subscription_id_t _unsubscription_id); diff --git a/implementation/routing/src/routing_manager_impl.cpp b/implementation/routing/src/routing_manager_impl.cpp index e317e6d..6f4fd14 100644 --- a/implementation/routing/src/routing_manager_impl.cpp +++ b/implementation/routing/src/routing_manager_impl.cpp @@ -1562,6 +1562,9 @@ bool routing_manager_impl::deliver_notification( std::shared_ptr<event> its_event = find_event(_service, _instance, its_method); if (its_event) { if (!its_event->is_provided()) { + if (its_event->get_subscribers().size() == 0) { + return true; // as there is nothing to do + } const uint32_t its_length(utility::get_payload_size(_data, _length)); std::shared_ptr<payload> its_payload = runtime::get()->create_payload(&_data[VSOMEIP_PAYLOAD_POS], @@ -3489,8 +3492,13 @@ void routing_manager_impl::log_version_timer_cbk(boost::system::error_code const #ifndef VSOMEIP_VERSION #define VSOMEIP_VERSION "unknown version" #endif + bool is_diag_mode(false); - VSOMEIP_INFO << "vSomeIP " << VSOMEIP_VERSION; + if (discovery_) { + is_diag_mode = discovery_->get_diagnosis_mode(); + } + VSOMEIP_INFO << "vSomeIP " << VSOMEIP_VERSION << " | (" + << ((is_diag_mode == true) ? "diagnosis)" : "default)"); { std::lock_guard<std::mutex> its_lock(version_log_timer_mutex_); version_log_timer_.expires_from_now( @@ -3914,7 +3922,8 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) { switch (_routing_state) { case vsomeip::routing_state_e::RS_SUSPENDED: { - VSOMEIP_INFO << "set routing to suspend mode"; + VSOMEIP_INFO << "Set routing to suspend mode, diagnosis mode is " + << ((discovery_->get_diagnosis_mode() == true) ? "active." : "inactive."); // stop processing of incoming SD messages discovery_->stop(); @@ -3958,7 +3967,8 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) { } case vsomeip::routing_state_e::RS_RESUMED: { - VSOMEIP_INFO << "set routing to resume mode"; + VSOMEIP_INFO << "Set routing to resume mode, diagnosis mode was " + << ((discovery_->get_diagnosis_mode() == true) ? "active." : "inactive."); // Reset relevant in service info for (const auto &its_service : get_offered_services()) { @@ -3967,6 +3977,9 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) { its_instance.second->set_is_in_mainphase(false); } } + // Switch SD back to normal operation + discovery_->set_diagnosis_mode(false); + // start processing of SD messages (incoming remote offers should lead to new subscribe messages) discovery_->start(); @@ -3981,10 +3994,10 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) { } case routing_state_e::RS_DIAGNOSIS: { - VSOMEIP_INFO << "set routing to diagnosis mode"; + VSOMEIP_INFO << "Set routing to diagnosis mode."; discovery_->set_diagnosis_mode(true); - // send StopOffer messages for all someip protocal services + // send StopOffer messages for all someip protocol services for (const auto &its_service : get_offered_services()) { for (const auto &its_instance : its_service.second) { if (host_->get_configuration()->is_someip( @@ -3998,7 +4011,8 @@ void routing_manager_impl::set_routing_state(routing_state_e _routing_state) { break; } case routing_state_e::RS_RUNNING: - VSOMEIP_INFO << "set routing to running mode"; + VSOMEIP_INFO << "Set routing to running mode, diagnosis mode was " + << ((discovery_->get_diagnosis_mode() == true) ? "active." : "inactive."); // Reset relevant in service info for (const auto &its_service : get_offered_services()) { @@ -4512,10 +4526,21 @@ void routing_manager_impl::send_unsubscription( } ); } else { - stub_->send_unsubscribe(find_local(_offering_client), + if (!stub_->send_unsubscribe(find_local(_offering_client), _subscribing_client, _service, _instance, _eventgroup, ANY_EVENT, - _pending_unsubscription_id); + _pending_unsubscription_id)) { + try { + const auto its_callback = std::bind( + &routing_manager_stub_host::on_unsubscribe_ack, + std::dynamic_pointer_cast<routing_manager_stub_host>(shared_from_this()), + _offering_client, _service, _instance, + _eventgroup, _pending_unsubscription_id); + io_.post(its_callback); + } catch (const std::exception &e) { + VSOMEIP_ERROR << __func__ << e.what(); + } + } } } @@ -4552,11 +4577,22 @@ void routing_manager_impl::send_subscription( } }); } else { // service hosted by local client - stub_->send_subscribe(find_local(_offering_client), + if (!stub_->send_subscribe(find_local(_offering_client), _subscribing_client, _service, _instance, _eventgroup, _major, ANY_EVENT, - _pending_subscription_id); + _pending_subscription_id)) { + try { + const auto its_callback = std::bind( + &routing_manager_stub_host::on_subscribe_nack, + std::dynamic_pointer_cast<routing_manager_stub_host>(shared_from_this()), + _subscribing_client, _service, _instance, + _eventgroup, ANY_EVENT, _pending_subscription_id); + io_.post(its_callback); + } catch (const std::exception &e) { + VSOMEIP_ERROR << __func__ << e.what(); + } + } } } diff --git a/implementation/routing/src/routing_manager_proxy.cpp b/implementation/routing/src/routing_manager_proxy.cpp index ca046ed..a54b691 100644 --- a/implementation/routing/src/routing_manager_proxy.cpp +++ b/implementation/routing/src/routing_manager_proxy.cpp @@ -349,7 +349,7 @@ void routing_manager_proxy::register_event(client_t _client, pending_event_registrations_.insert(registration); } } - if (is_first) { + if (is_first || _is_provided) { routing_manager_base::register_event(_client, _service, _instance, _event,_eventgroups, _is_field, _cycle, _change_resets_cycle, diff --git a/implementation/routing/src/routing_manager_stub.cpp b/implementation/routing/src/routing_manager_stub.cpp index a63642a..ffc8b09 100644 --- a/implementation/routing/src/routing_manager_stub.cpp +++ b/implementation/routing/src/routing_manager_stub.cpp @@ -1224,7 +1224,7 @@ void routing_manager_stub::broadcast(const std::vector<byte_t> &_command) const } } -void routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _target, +bool routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _target, client_t _client, service_t _service, instance_t _instance, eventgroup_t _eventgroup, major_version_t _major, event_t _event, pending_subscription_id_t _subscription_id) { @@ -1252,7 +1252,7 @@ void routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _ta std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + 10], &_subscription_id, sizeof(_subscription_id)); - _target->send(its_command, sizeof(its_command)); + return _target->send(its_command, sizeof(its_command)); } else { VSOMEIP_WARNING << __func__ << " Couldn't send subscription to local client [" << std::hex << std::setw(4) << std::setfill('0') << _service << "." @@ -1261,10 +1261,11 @@ void routing_manager_stub::send_subscribe(std::shared_ptr<vsomeip::endpoint> _ta << std::hex << std::setw(4) << std::setfill('0') << _event << "]" << " subscriber: "<< std::hex << std::setw(4) << std::setfill('0') << _client; + return false; } } -void routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target, +bool routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _target, client_t _client, service_t _service, instance_t _instance, eventgroup_t _eventgroup, event_t _event, pending_subscription_id_t _unsubscription_id) { @@ -1288,7 +1289,7 @@ void routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _ std::memcpy(&its_command[VSOMEIP_COMMAND_PAYLOAD_POS + 8], &_unsubscription_id, sizeof(_unsubscription_id)); - _target->send(its_command, sizeof(its_command)); + return _target->send(its_command, sizeof(its_command)); } else { VSOMEIP_WARNING << __func__ << " Couldn't send unsubscription to local client [" << std::hex << std::setw(4) << std::setfill('0') << _service << "." @@ -1297,6 +1298,7 @@ void routing_manager_stub::send_unsubscribe(std::shared_ptr<vsomeip::endpoint> _ << std::hex << std::setw(4) << std::setfill('0') << _event << "]" << " subscriber: "<< std::hex << std::setw(4) << std::setfill('0') << _client; + return false; } } diff --git a/implementation/runtime/src/application_impl.cpp b/implementation/runtime/src/application_impl.cpp index 720ddb1..918b993 100644 --- a/implementation/runtime/src/application_impl.cpp +++ b/implementation/runtime/src/application_impl.cpp @@ -6,6 +6,8 @@ #include <future> #include <thread> #include <iomanip> +#include <iostream> +#include <boost/log/exceptions.hpp> #ifndef _WIN32 #include <dlfcn.h> @@ -352,6 +354,11 @@ void application_impl::start() { << std::this_thread::get_id(); try { io_.run(); +#ifndef _WIN32 + } catch (const boost::log::v2_mt_posix::system_error &e) { + std::cerr << "catched boost::log system_error in I/O thread" << std::endl << + boost::current_exception_diagnostic_information(); +#endif } catch (const std::exception &e) { VSOMEIP_ERROR << "application_impl::start() " "catched exception:" << e.what(); @@ -384,6 +391,11 @@ void application_impl::start() { << name_ << ") is: " << std::hex << std::this_thread::get_id(); try { io_.run(); +#ifndef _WIN32 + } catch (const boost::log::v2_mt_posix::system_error &e) { + std::cerr << "catched boost::log system_error in I/O thread" << std::endl << + boost::current_exception_diagnostic_information(); +#endif } catch (const std::exception &e) { VSOMEIP_ERROR << "application_impl::start() catched exception:" << e.what(); throw; @@ -1697,7 +1709,7 @@ void application_impl::invoke_handler(std::shared_ptr<sync_handler> &_handler) { std::shared_ptr<sync_handler> its_sync_handler = std::make_shared<sync_handler>(_handler->service_id_, _handler->instance_id_, _handler->method_id_, - _handler->eventgroup_id_, _handler->session_id_, + _handler->session_id_, _handler->eventgroup_id_, _handler->handler_type_); boost::asio::steady_timer its_dispatcher_timer(io_); diff --git a/implementation/service_discovery/include/service_discovery.hpp b/implementation/service_discovery/include/service_discovery.hpp index caec99e..92d80d3 100644 --- a/implementation/service_discovery/include/service_discovery.hpp +++ b/implementation/service_discovery/include/service_discovery.hpp @@ -65,6 +65,9 @@ public: std::shared_ptr<serviceinfo> _info) = 0; virtual void set_diagnosis_mode(const bool _activate) = 0; + + virtual bool get_diagnosis_mode() = 0; + virtual void remote_subscription_acknowledge( service_t _service, instance_t _instance, eventgroup_t _eventgroup, client_t _client, bool _accepted, diff --git a/implementation/service_discovery/include/service_discovery_impl.hpp b/implementation/service_discovery/include/service_discovery_impl.hpp index 3cf3396..49ccab2 100644 --- a/implementation/service_discovery/include/service_discovery_impl.hpp +++ b/implementation/service_discovery/include/service_discovery_impl.hpp @@ -96,6 +96,8 @@ public: void set_diagnosis_mode(const bool _activate); + bool get_diagnosis_mode(); + void remote_subscription_acknowledge( service_t _service, instance_t _instance, eventgroup_t _eventgroup, client_t _client, bool _acknowledged, diff --git a/implementation/service_discovery/src/service_discovery_impl.cpp b/implementation/service_discovery/src/service_discovery_impl.cpp index 6042526..2fa5f57 100644 --- a/implementation/service_discovery/src/service_discovery_impl.cpp +++ b/implementation/service_discovery/src/service_discovery_impl.cpp @@ -1799,7 +1799,7 @@ bool service_discovery_impl::insert_offer_service( } } else { if (!find_existing_option<ipv6_option_impl, ipv6_address_t>(_message, - unicast_.to_v6().to_bytes(), its_reliable->get_local_port(), + unicast_.to_v6().to_bytes(), its_unreliable->get_local_port(), layer_four_protocol_e::UDP, option_type_e::IP6_ENDPOINT)) { its_endpoint_size = VSOMEIP_SOMEIP_SD_IPV6_OPTION_SIZE; } @@ -3310,6 +3310,10 @@ void service_discovery_impl::set_diagnosis_mode(const bool _activate) { is_diagnosis_ = _activate; } +bool service_discovery_impl::get_diagnosis_mode() { + return is_diagnosis_; +} + void service_discovery_impl::remote_subscription_acknowledge( service_t _service, instance_t _instance, eventgroup_t _eventgroup, client_t _client, bool _acknowledged, |