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

Support marking nodes for maintenance #6

Closed
tgross opened this issue Nov 5, 2015 · 4 comments
Closed

Support marking nodes for maintenance #6

tgross opened this issue Nov 5, 2015 · 4 comments

Comments

@tgross
Copy link
Contributor

tgross commented Nov 5, 2015

From https://www.joyent.com/blog/automatic-dns-updates-with-containerbuddy:

The problem is that if we simply remove the old container we'll have a period of lost traffic between the time we remove the container and the TTL expires. We need a way to signal Containerbuddy to mark the node for planned maintenance. I'll circle back to that in a revision to Containerbuddy and discuss this change in an upcoming post.

cc @misterbisson

@tgross tgross self-assigned this Nov 5, 2015
@tgross
Copy link
Contributor Author

tgross commented Nov 17, 2015

Implementation thoughts:

  • I'm going to update the internal API to use the term SendHeartbeat instead of WriteHealthCheck for clarity
  • For initiating the action, we can have Containerbuddy accept a POSIX signal. SIGINT or SIGSTOP sound like the correct ones but if I had to hazard a guess there are probably bits of the Docker engine that are going to assume one or the other of these is available. So maybe using a SIGUSR1 would be better.
  • When the signal is received, we should pause the heartbeat goroutine and send a MarkForMaintenance function call.
  • The MarkForMaintenance function should be a new method of the DiscoveryService interface.
  • In the Consul implementation, we can trigger an immediate marking of the node as "failed" by sending the appropriate API call to Consul (ref https://godoc.org/github.com/hashicorp/consul/api#Agent.FailTTL). On the next poll from a downstream client, that node will be removed from the list of heathy.

@misterbisson
Copy link
Contributor

Agreed that SendHeartbeat seems more semantically correct for what's actually happening there.

@tgross
Copy link
Contributor Author

tgross commented Nov 24, 2015

#15 has been merged and I've got a release awaiting #19.

@tgross
Copy link
Contributor Author

tgross commented Nov 24, 2015

@tgross tgross closed this as completed Nov 24, 2015
@tgross tgross added released and removed open PR labels Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants