From b5e1c7cd0b890888014ca7e4d6cd61e01802d03a Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:30:05 +0200 Subject: [PATCH 1/3] fix abort in some cases with DDS --- .../realdds/src/dds-network-adapter-watcher.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/third-party/realdds/src/dds-network-adapter-watcher.cpp b/third-party/realdds/src/dds-network-adapter-watcher.cpp index 4cd3fd1e6d..85078e7a92 100644 --- a/third-party/realdds/src/dds-network-adapter-watcher.cpp +++ b/third-party/realdds/src/dds-network-adapter-watcher.cpp @@ -72,8 +72,14 @@ class network_adapter_watcher_singleton ~network_adapter_watcher_singleton() { _adapter_watcher.reset(); // signal the thread to finish - if( _th.joinable() ) - _th.join(); + try { + if (_th.joinable()) + _th.join(); + } + catch (std::system_error&) + { + std::cerr << "join failed, thread might no longer be joinable"; + } } void update_ips( ip_set * p_new_ips = nullptr, ip_set * p_old_ips = nullptr ) From 83a7d6e9f559653c1ffbd30213485135cb3b0c39 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Wed, 25 Dec 2024 09:56:36 +0200 Subject: [PATCH 2/3] adding the error message to log --- third-party/realdds/src/dds-network-adapter-watcher.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/third-party/realdds/src/dds-network-adapter-watcher.cpp b/third-party/realdds/src/dds-network-adapter-watcher.cpp index 85078e7a92..3abd5e3306 100644 --- a/third-party/realdds/src/dds-network-adapter-watcher.cpp +++ b/third-party/realdds/src/dds-network-adapter-watcher.cpp @@ -72,13 +72,14 @@ class network_adapter_watcher_singleton ~network_adapter_watcher_singleton() { _adapter_watcher.reset(); // signal the thread to finish - try { + try + { if (_th.joinable()) _th.join(); } - catch (std::system_error&) + catch (std::system_error& e) { - std::cerr << "join failed, thread might no longer be joinable"; + LOG_ERROR("join failed, thread might no longer be joinable, Error:" << e.what()); } } From ec36486c27c216ec224437ca25dade3520059632 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Thu, 26 Dec 2024 08:50:45 +0200 Subject: [PATCH 3/3] update log error message --- third-party/realdds/src/dds-network-adapter-watcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/realdds/src/dds-network-adapter-watcher.cpp b/third-party/realdds/src/dds-network-adapter-watcher.cpp index 3abd5e3306..5a6ba90e72 100644 --- a/third-party/realdds/src/dds-network-adapter-watcher.cpp +++ b/third-party/realdds/src/dds-network-adapter-watcher.cpp @@ -79,7 +79,7 @@ class network_adapter_watcher_singleton } catch (std::system_error& e) { - LOG_ERROR("join failed, thread might no longer be joinable, Error:" << e.what()); + LOG_ERROR("Network adapter watcher termination failed: " << e.what()); } }