-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix abort in some cases with DDS #13627
base: development
Are you sure you want to change the base?
Conversation
@maloel can you review?
the condition for joinable and the actual join actions are not atomic. Currently this issue was also raised by validation as a critical BUG. |
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the opening bracket to a new line
} | ||
catch (std::system_error&) | ||
{ | ||
std::cerr << "join failed, thread might no longer be joinable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use LOG_ERROR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, if there's an error, there's an error message too, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the comments; otherwise good to go
} | ||
catch (std::system_error& e) | ||
{ | ||
LOG_ERROR("join failed, thread might no longer be joinable, Error:" << e.what()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this will work.
Can you try to see if it works and you see the e.what()?
You might need to use rsutils::from() <<
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_ERROR has <<
, if that was the concern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ask that we make error messages a little nicer, though: capitalization, e.g.:
LOG_ERROR( "Network adapter watcher termination failed: " << e.what() );
@Nir-Az up to you whether this is an error the user should see - we might want to leave it debug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure why not, @AviaAv can you handle please?
Fixed an issue where we randomly see an error where abort() is called after we finish using DDS (in the d'tor), added a try catch block due to the race condition there
Tracked on: [LRS-1212]