-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
[💡 FEATURE REQUEST]: server.on_init with an option to crash the server #2075
Comments
Hey @wizardist 👋🏻 |
@rustatian just to confirm, have you assigned the FR to yourself to work on it? 😊 This is really great. |
Sure, why not 😄 You want to try it yourself? |
@rustatian we're onboarding RoadRunner for production workloads, and making the teams familiar with the RR codebase is beneficial. Let me check with the Legal, and if we have a green light to contribute to RR codebase, I'll assign one of my team members, or myself, to this issue. Let me unassign you from it so there's clarity on this. If we hit a red light, I'll ping you and re-assign you back. But I really doubt it will happen. |
I've already implemented this 😄 |
You may build your RR binary with Velox (roadrunner-server/velox + you may check our docs for the instuction) with that change (just use |
Thank you. I built it from master and it successfully fails if init script returns error with |
Plugin
Server
I have an idea!
Per documentation,
While this makes sense for many use cases, we want to use
server.on_init
to make preflight checks when a Kubernetes pod starts. While we could do an init container instead, we want to use RoadRunner as much as possible, and crashing PID 1 would work just fine in our case.I suggest to add
server.on_init.fail_on_error
boolean configuration option that will relay the exit code from the on_init script and will exit the master process, thereby crashing the container.I hope that others with containerized environments may benefit from this too. I would like to get a go-ahead from the community before we submit a pull request with necessary changes.
The text was updated successfully, but these errors were encountered: