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

[feat] /services/{service}/restart implementation #45

Closed
6 tasks done
lgrd opened this issue Mar 9, 2023 · 0 comments · Fixed by #53
Closed
6 tasks done

[feat] /services/{service}/restart implementation #45

lgrd opened this issue Mar 9, 2023 · 0 comments · Fixed by #53
Assignees
Labels
enhancement New feature or request

Comments

@lgrd
Copy link
Collaborator

lgrd commented Mar 9, 2023

Need

Actually, there is no restart route for a service. But it could be useful in different cases. For instance, now, it is easy to add and the other admin routes are not available. But in the future, if you have a problem with a specific route, a restart could be useful.

Tasks

  • Update API doc to be sure of the IO (ex. GET or POST, responses if ok or not).
  • Code it (see next paragrah)
  • Update doc (ex. functionalities, changelog)
  • Update tests (new classes if there are; rtest for this route)
  • Test memory leaks? Tested manually, but an issue where created to investigate it in a more detailed way. See [fix] Analyse memory issues #57
  • Run tests inside docker (rtest, ctest, utest, itest)

Code

  • Add the route inside the router of the admin API
  • Create a function inside the administrator to handle this restart
  • Create a function inside the serviceManager to stop and load the service (this is the restart)
  • Create the same function inside administeredService and its child classes (serviceProcess and serviceInsider) to stop the service. The function to load the service has already been written.
    • serviceInsider : call to this._serviceInstance.stopAllServers() and this._serviceInstance = null to let the garbage collector take it
    • serviceProcess : send a kill via this._serviceInstance.kill(), and this._serviceInstance = null to let the garbage collector take it
  • Modify service.initIPC() to add a process.on('SIGKILL') which call this.stopAllServers()
@lgrd lgrd added the enhancement New feature or request label Mar 9, 2023
@lgrd lgrd moved this to In Progress in Road2 Roadmap Mar 15, 2023
@lgrd lgrd closed this as completed in #53 Mar 24, 2023
@github-project-automation github-project-automation bot moved this to ✅ Done in Road2 backlog Mar 24, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Road2 Roadmap Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants