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

Start service dependencies one by one #598

Merged
merged 3 commits into from
Nov 29, 2018
Merged

Start service dependencies one by one #598

merged 3 commits into from
Nov 29, 2018

Conversation

krhubert
Copy link
Contributor

closes #382

@NicolasMahe
Copy link
Member

What is the order of start?
Does the service start before the dependencies or the other way?

I would say it makes sense to start the dependencies first. (as the name suggest, the service is dependent on them).

@krhubert
Copy link
Contributor Author

krhubert commented Nov 29, 2018

Before there was no order of starting. And it's the pbm because some dependencies may eg. connect to service and the other opposite, so it's hard to tell the one perfect order.

For example you deploy website as servcie and has db as a dependency so service must start first.

Second, you deploy database and eg. crawlers as a dependency in that case db must start first so crawler can connect to it

@NicolasMahe
Copy link
Member

For info, the dependencies are started before the service itself. LGFM

@NicolasMahe NicolasMahe merged commit fcea30b into dev Nov 29, 2018
@NicolasMahe NicolasMahe deleted the fix/service-start branch November 29, 2018 10:22
@antho1404
Copy link
Member

Why the dependencies are starting before the service ? This is just based on a map so it shouldn't by default, this needs to be added for me, I don't see how it can be done with the code here

@NicolasMahe
Copy link
Member

NicolasMahe commented Nov 29, 2018

Because of the way we inject the configuration to dependencies. See end of func deploy:
https://github.com/mesg-foundation/core/blob/fcea30b78145f1b27a3979555418560745a8186f/service/service.go#L193-L207

Actually, why are we keeping configuration if it copied to dependencies?
It could be copied to service way before, in service.injectDefinition:
https://github.com/mesg-foundation/core/blob/fcea30b78145f1b27a3979555418560745a8186f/service/inject_definition.go#L11-L26

Let's either remove configuration from service, or let's not copy config in dependencies.

see #624

@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/start-docker-services-in-parallel/144/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.

service: service.Start() can block forever
5 participants