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
Is your feature request related to a problem? Please describe.
Uncertain whether to file this should be a bug or a documentation request.
I will describe the issue for the public, and welcome your recommendations.
I am working on a less-than-trivial system that reacts to a control message by building internal logic, including setting up new subscriptions. My base message handlers ultimately call StandardRouter.RegisterHandler(), which will block thanks to StandardRouter.Router()'s previous lock. (I manage to reproduce this systematically when one client publishes a retained control message triggering this setup logic while the receiving client is offline and then activates, connects and receives the message in its onConnect() handler. Currently trying to figure out how to structure my code to circumvent this, but not there yet.)
Describe the solution you'd like
A low impact solution (in both senses) would be documentation for StandardRouter, pointing out the pitfall.
I personally would consider releasing the lock in StandardRouter.Route() after copying the subscriptions map and before calling the handlers would help, but I can't guess how this will affect possible performance requirements the project has in here.
Happy to submit a pull request in case of consensus.
The text was updated successfully, but these errors were encountered:
I believe that the router changes in the next release should provide a way around this (the router is no longer the default approach; instead you can use OnPublishReceived and handle messages without the router.
Is your feature request related to a problem? Please describe.
Uncertain whether to file this should be a bug or a documentation request.
I will describe the issue for the public, and welcome your recommendations.
I am working on a less-than-trivial system that reacts to a control message by building internal logic, including setting up new subscriptions. My base message handlers ultimately call StandardRouter.RegisterHandler(), which will block thanks to StandardRouter.Router()'s previous lock. (I manage to reproduce this systematically when one client publishes a retained control message triggering this setup logic while the receiving client is offline and then activates, connects and receives the message in its onConnect() handler. Currently trying to figure out how to structure my code to circumvent this, but not there yet.)
Describe the solution you'd like
A low impact solution (in both senses) would be documentation for StandardRouter, pointing out the pitfall.
I personally would consider releasing the lock in StandardRouter.Route() after copying the subscriptions map and before calling the handlers would help, but I can't guess how this will affect possible performance requirements the project has in here.
Happy to submit a pull request in case of consensus.
The text was updated successfully, but these errors were encountered: