Skip to content
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

Cleanup ProcessHostMonarch startup, shutdown and restart logic #116

Closed
volllly opened this issue Oct 23, 2023 · 1 comment · Fixed by #114
Closed

Cleanup ProcessHostMonarch startup, shutdown and restart logic #116

volllly opened this issue Oct 23, 2023 · 1 comment · Fixed by #114
Labels
feature-request New feature or request

Comments

@volllly
Copy link
Contributor

volllly commented Oct 23, 2023

The ProcessHostMonarch is responsigble for managing the Plebean processes.

We need to add exponential backoff to the restarting mechanism if the Plebean process crashes.

We also need to restructure the code to make it more easy to understand and maintain.

@pawelvds
Copy link
Contributor

Thank you for the task you created for this "problem" @volllly

During the implementation of the previous issue I've reviewed ProcessHostMonarch class and I've noticed a few areas for potential improvements.
I agree with you, let's clear _plebianLogBuffer in the Started() method to avoid any remains from previous runs for example.
We have to also focus on Restart Logic and in this case I believe it would be a good idea to adding a mechanism to limit the number of restart attempts (restart limit) to avoid the process crashing and restarting over and over again - may result in endless loops.
Another thing what you also mentioned before is code readibility I still think about that but first thing what I see is extracting the process exit logic from the anonymous function in _process.Exited to its own method. would make it easier to understand what happens when the process exits.
Currently, much of the logic is contained in an anonymous function assigned to the _process.Exited event 😞

@volllly volllly linked a pull request Oct 25, 2023 that will close this issue
4 tasks
@volllly volllly closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
2 participants