Skip to content

Separate service LB & SD from network plumbing#1550

Merged
mavenugo merged 1 commit intomoby:masterfrom
sanimej:plumb
Nov 18, 2016
Merged

Separate service LB & SD from network plumbing#1550
mavenugo merged 1 commit intomoby:masterfrom
sanimej:plumb

Conversation

@sanimej
Copy link

@sanimej sanimej commented Nov 11, 2016

EnableService and DisableService APIs allow a service to be accessible through Service Discovery and Load Balancer only if the image's healthcheck passes. Currently these APIs control the network plumbing as well. So if the healthcheck of an image tries to connect to other services on the same network it will not work. This PR separates the networking plumbing from the <Enable|Disable>Service APIs.

This will also help in the upgrade case where we want to take the service out of availability (ie: no new client connections to the service), but the existing connections should work till a grace period.

Signed-off-by: Santhosh Manohar [email protected]

agent.go Outdated
}

for _, te := range ep.joinInfo.driverTableEntries {
if err := n.ctrlr.agent.networkDB.CreateEntry(te.tableName, n.ID(), te.key, te.value); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

agent can come and go.
Please acquire the agent pointer under lock before getting into the loop.


for _, te := range ep.joinInfo.driverTableEntries {
if err := n.ctrlr.agent.networkDB.CreateEntry(te.tableName, n.ID(), te.key, te.value); err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it could help to add more context to the returned error so that we know entry creation failed during driver info addition phase, so that we distinguish from service info addition phase.

Copy link
Author

Choose a reason for hiding this comment

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

networkdb errors include the table_name which is be sufficient to infer what failed. Corrected one error message in which table name wasn't included.

agent.go Outdated
}

for _, te := range ep.joinInfo.driverTableEntries {
if err := n.ctrlr.agent.networkDB.DeleteEntry(te.tableName, n.ID(), te.key); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

same here and in the service function, pls acquire agent pointer under lock before getting into the loop

@sanimej
Copy link
Author

sanimej commented Nov 17, 2016

@aboch Addressed the comment. PTAL

@aboch
Copy link
Contributor

aboch commented Nov 17, 2016

LGTM

1 similar comment
@mavenugo
Copy link
Contributor

LGTM

@mavenugo mavenugo merged commit f36e733 into moby:master Nov 18, 2016
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.

3 participants