You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of the poller thread calling poll() is not thread-safe:
_pollItems is accessed from the thread without synchronization, that can crash when the MDClient is destroyed while the thread is running. _pollItems is also modified in disconnect()
Other members such as _subscriptions and _requests are accessed without synchronization.
I think there should be an explicit poller->request_stop(); poller->join() in ~MDClientCtx
While at it:
if (_subscriptions.contains(receivedEvent.serviceName)) {
_subscriptions.at(receivedEvent.serviceName).callback(receivedEvent); // callback
}
can be replaced by a single lookup (find()) instead of two. Same for _requests below.
The text was updated successfully, but these errors were encountered:
MDClientCtx has some threading issues:
The use of the poller thread calling poll() is not thread-safe:
_pollItems
is accessed from the thread without synchronization, that can crash when the MDClient is destroyed while the thread is running. _pollItems is also modified in disconnect()poller->request_stop(); poller->join()
in ~MDClientCtxWhile at it:
if (_subscriptions.contains(receivedEvent.serviceName)) {
_subscriptions.at(receivedEvent.serviceName).callback(receivedEvent); // callback
}
can be replaced by a single lookup (find()) instead of two. Same for _requests below.
The text was updated successfully, but these errors were encountered: