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

Stop services when core stop #790

Merged
merged 5 commits into from
Mar 8, 2019
Merged

Conversation

antho1404
Copy link
Member

Right now we rely on the CLI to stop all service before stoping the core. This is not really nice and create issues if we stop the core with another CLI (docker service rm for exemple).

When the Core stops, it will stop all the running services, close the api and then exit.

@antho1404 antho1404 changed the base branch from master to dev February 20, 2019 06:15
@antho1404 antho1404 requested review from krhubert and NicolasMahe and removed request for krhubert February 20, 2019 06:27
Copy link
Contributor

@ilgooz ilgooz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but we got to delete previous service stopping part from the commands provider #792

@antho1404
Copy link
Member Author

not really necessary, services will anyway be stopped but that simplifies the cli for sure

@antho1404
Copy link
Member Author

@mesg-foundation/core can you please review

core/main.go Show resolved Hide resolved
core/main.go Outdated Show resolved Hide resolved
core/main.go Outdated Show resolved Hide resolved
core/main.go Outdated Show resolved Hide resolved
@antho1404 antho1404 force-pushed the feature/stop-services-on-core-stop branch from 0656331 to acd03bb Compare March 1, 2019 06:19
core/main.go Outdated Show resolved Hide resolved
server, err := initGRPCServer(c)
if err != nil {
// init system services.
if err := deployCoreServices(dep.config, dep.api); err != nil {
Copy link
Member

@NicolasMahe NicolasMahe Mar 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to start the gRPC server before deploying the Core services:
The services will fail (and restart) until the gRPC server is up and running.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just kept the same behavior here as before just refactors it but the behavior is the same.
I agree it's not perfect, optimal solution would be:

  • deploy service
  • start service api
  • start deployed services
  • start core api

But this is not the purpose of this PR

if err != nil {
return err
}
for _, s := range services {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could all the services be stop at the same time in parallel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could I just wanted to make it simple for now. This can be done in another PR

@NicolasMahe
Copy link
Member

lgtm, but we got to delete previous service stopping part from the commands provider #792

Modif of https://github.com/mesg-foundation/core/pull/792/files are not in this PR anymore. Maybe because of a force push.

@antho1404 antho1404 force-pushed the feature/stop-services-on-core-stop branch from 0926c24 to 220295e Compare March 8, 2019 10:58
@antho1404
Copy link
Member Author

modifications from #792 in the PR again.

@ilgooz ilgooz mentioned this pull request Mar 8, 2019
@ilgooz
Copy link
Contributor

ilgooz commented Mar 8, 2019

Manual tests are OK. I see a weird bug sometimes(we fixed this before), ethwallet service seems running but it's Docker service is actually not exists. I'll open an issue, if I can reproduce again.

@ilgooz ilgooz merged commit 0bd7b53 into dev Mar 8, 2019
@ilgooz ilgooz deleted the feature/stop-services-on-core-stop branch March 8, 2019 15:16
@mesg-bot
Copy link
Member

This pull request has been mentioned on MESG Community. There might be relevant details there:

https://forum.mesg.com/t/graceful-shutdown/262/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants