-
Notifications
You must be signed in to change notification settings - Fork 57
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
chore: Separation of node health and initialization state from rln_relay #2612
Conversation
…tus. Make (only) health endpoint avail early and install others in the last stage of node setup.
|
You can find the image built from this PR at
Built from 51b775e |
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.
Approving not to be a blocker but I have the feeling we may need some further refactoring
## Health REST API | ||
installHealthApiHandler(server.router, nodeHealthMonitor) | ||
|
||
restServerNotInstalledTab["admin"] = | ||
"/admin endpoints are not available while initializing." | ||
restServerNotInstalledTab["debug"] = | ||
"/debug endpoints are not available while initializing." | ||
restServerNotInstalledTab["relay"] = | ||
"/relay endpoints are not available while initializing." | ||
restServerNotInstalledTab["filter"] = | ||
"/filter endpoints are not available while initializing." | ||
restServerNotInstalledTab["lightpush"] = | ||
"/lightpush endpoints are not available while initializing." | ||
restServerNotInstalledTab["store"] = | ||
"/store endpoints are not available while initializing." | ||
|
||
server.start() | ||
info "Starting REST HTTP server", url = "http://" & $address & ":" & $port & "/" | ||
|
||
ok(some(server)) |
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.
This block should fall under rest
folder
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 agree, this past... Among with others... Needs refactoring. Here I wanted to keep changes minimum at once.
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.
Superrr! Thanks so much! 🤩
Adding some small questions, but not blockers
What do you think of the idea that each protocol should report their own "health"? I envision each protocol/sub-system produce a report in a standard format to the rest server when asked. Also to me the concept of node health does not make sense. A node is just a collection of protocols. If my node is un/healthy what does that mean? My 0.02$ |
…nient script for checking node health
You can find the image built from this PR at
Built from 3ef1d2d |
You can find the image built from this PR at
Built from 3ef1d2d |
Yes, that what I think too, but nim OOP is a bit dumb and does not provide proper polymorphism.
Note: WakuNodeHealthMonitor is in charge.
Well it does have meaning. During startup we faced with health report derived from (and only from) RlnRelay which does not have a constant state as it is time to time synchronizing. So I found it better to keep an overall state for the configured node. Please notice: This PR is about the enhance the existing /health in two ways only (while keeping changes minimal as possible):
|
Sorry, my comment was meant as next step discussion. I agree with the changes here 💯 |
Description
In order to be able to give early status of node startup even during initialization, rest server start and /health endpoint installation must have been separated.
This separation allows users to use health endpoint right after nodes starts and can get comprehensive information about node health status.
Currently a "global" node health status is maintained and as we already had it endpoints gives updates on rln_relay state.
Changes
How to test
curl -X http://localhost:8645/health
2/b. run ./script/chkhealth.sh (located in nwaku repositroy)
Issue
#2020