Skip to content

Disable service on release network#35960

Merged
cpuguy83 merged 2 commits into
moby:masterfrom
abhi:service
Jan 18, 2018
Merged

Disable service on release network#35960
cpuguy83 merged 2 commits into
moby:masterfrom
abhi:service

Conversation

@abhi
Copy link
Copy Markdown
Contributor

@abhi abhi commented Jan 8, 2018

This PR contains a fix for #30321. There was a #31142
PR intending to fix the issue by adding a delay between disabling the
service in the cluster and the shutdown of the tasks. However
disabling the service was not deleting the service info in the cluster.
Added a fix to delete service info from cluster and verified using siege
to ensure there is zero downtime on rolling update of a service.In order
to support it and ensure consitency of enabling and disable service knob
from the daemon, we need to ensure we disable service when we release
the network from the container. This helps in making the enable and
disable service less racy. The corresponding part of libnetwork fix is
part of moby/libnetwork#1824

Signed-off-by: abhi [email protected]

- What I did
In order to ensure enable and disable a service on an sandbox less racy , explictly disable service on the sandbox during a container exit event on the network side. This entry point is the releaseNetwork action which triggers the tearing of the network resource for a container.
- How I did it
Added DisableService action on releaseNetwork
- How to verify it
This is particularly important during rolling update of a service and when the tasks in a swarm service goes down. Verified using siege and performing zero downtime rolling update.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@abhi
Copy link
Copy Markdown
Contributor Author

abhi commented Jan 8, 2018

@fcrisciani

@thaJeztah
Copy link
Copy Markdown
Member

ping @abhi can you rebase this PR? Also looks like you added a file that shouldn't be there (I noticed theres a stack dump in there);

screen shot 2018-01-16 at 11 19 26

@thaJeztah
Copy link
Copy Markdown
Member

Looks like you updated the PR; note that GitHub doesn't send out notifications when you update, so its best to comment or "ping" someone after you did so 😄

@abhi
Copy link
Copy Markdown
Contributor Author

abhi commented Jan 17, 2018

@thaJeztah the guy I need to ping sits next to me :D Will do next time.
@fcrisciani PTAL

Comment thread daemon/container_operations.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: logrus.WithField("container", container.ID).WithError(err).WithField("sandbox", sid).Error("Error removing service from sandbox")

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah Jan 17, 2018

Choose a reason for hiding this comment

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

Or .WithFields();

logrus.WithFields(logrus.Fields{"container": container.ID, "sandbox": sid}).WithError(err).Error("Error removing service from sandbox")

@fcrisciani
Copy link
Copy Markdown
Contributor

LGTM after the log change 👍

abhi added 2 commits January 17, 2018 14:19
This PR contains a fix for moby#30321. There was a moby#31142
PR intending to fix the issue by adding a delay between disabling the
service in the cluster and the shutdown of the tasks. However
disabling the service was not deleting the service info in the cluster.
Added a fix to delete service info from cluster and verified using siege
to ensure there is zero downtime on rolling update of a service.In order
to support it and ensure consitency of enabling and disable service knob
from the daemon, we need to ensure we disable service when we release
the network from the container. This helps in making the enable and
disable service less racy. The corresponding part of libnetwork fix is
part of moby/libnetwork#1824

Signed-off-by: abhi <[email protected]>
Signed-off-by: abhi <[email protected]>
@abhi
Copy link
Copy Markdown
Contributor Author

abhi commented Jan 17, 2018

@thaJeztah @cpuguy83 done.

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

I'm not sure I like the ambiguity of the "service" term, but it is what it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants