-
Notifications
You must be signed in to change notification settings - Fork 47
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 deadlock when updating camera & renderer properties via Rockets #569
Conversation
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.
Just tested, looks OK.
@@ -1214,7 +1218,7 @@ class RocketsPlugin::Impl | |||
PropertyMap props = object.getPropertyMap(); | |||
if (::from_json(props, request.message)) | |||
{ | |||
object.updateProperties(props); | |||
object.updateProperties(props, false); |
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.
Is it OK to not update the UI if you make changes from a notebook? Or does the rebroadcast at the bottom solve that problem?
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.
Try it out :)
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.
Yes, the rebroadcast solves that. The callback triggered by markModified() is needed for 'internal' and plugin changes.
I'll fix this differently, hang tight and hold on. |
Updated. Please review again. |
uintptr_t* _currentClientID; | ||
}; | ||
|
||
void bindEndpoint(const std::string& method, |
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.
No leading _?
@@ -1254,6 +1328,9 @@ class RocketsPlugin::Impl | |||
std::unordered_map<std::string, std::pair<std::mutex, Throttle>> _throttle; | |||
std::vector<std::function<void()>> _delayedNotifies; | |||
std::mutex _delayedNotifiesMutex; | |||
static constexpr uintptr_t NO_CURRENT_CLIENT{ | |||
std::numeric_limits<uintptr_t>::max()}; |
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.
If this is representing an opaque pointer, you can also use 0 for brevity.
} | ||
|
||
template <typename Params> | ||
void _connectEndpoint(const std::string& method, |
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.
Why these methods are not called bind as well? Because they return 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.
Because in rockets they are called connect as well.
Due the data race fixes in the latest Rockets versions, it revealed this wrong behavior in Brayns, where the updates on property objects from within Rockets shall not trigger the onModified() callback which would lead to an unnecessary (and deadlocking) notification.
Due the data race fixes in the latest Rockets versions, it revealed this wrong
behavior in Brayns, where the updates on property objects from within Rockets
shall not trigger the onModified() callback which would lead to an
unnecessary (and deadlocking) notification.