-
Notifications
You must be signed in to change notification settings - Fork 492
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 RpcMonitor init in HealthMonitor #12196
Fix RpcMonitor init in HealthMonitor #12196
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.
tACK - please review my additions.
If anyone is reviewing this. The solution might seem to be a hack. But the UI needs to be displayed and some services initializes later and that is a legitimate situation. What should the UI do if the service is not ready or not even exist? The question answered here by a loop and null check. This is fixing the issue. I checked alternate solutions on the business side and got more ugly solutions. |
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.
tACK
@molnard A more nuanced and general solution to this problem is to wrap the services in a monad (Task). Then the UI code could request them like this:
which would await until the service is ready. That would remove the endless loop (which I got to admit is a little hacky). Only downside to this approach is that you can't await inside a constructor, and many of the Model classes in the UI are doing just that: referencing services in their constructor and performing event handling on them. If we moved more of the UI code to asyncs instead of ctors, we could further defer the dependencies from the UI code to these services, which means we could start the UI earlier. |
That is a goal I would like us to achieve until the next release. I noticed lately with the releases that the Wasabi window pops up slowly. It is almost 10 seconds on my laptop. |
Fixes #12066