-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
agent: move DNSServer to apiServers #8623
Conversation
a.logger.Info("Started DNS server", | ||
"address", addr.String(), | ||
"network", addr.Network(), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this change, this log message comes from apiServers.Start
// Unlike the HTTP server, the dns.Server listens and serves in the same call. | ||
// We could fix this by calling ActivateAndServe instead of ListenAndServe, | ||
// however that would require duplicating the network switch/case in | ||
// ListenAndServe. Do we actually support more than one network type? | ||
// For now we are handling this difference by waiting up to a second for | ||
// the listener to listen. | ||
// TODO: fix this by using dns.Server.ActivateAndServe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the old behaviour as well. I've kept it for now, but I think we can change it in the future. It'll be much easier to test with the DNSServer is better isolated from Agent.
In preparation for moving the dns servers into apiServers. This will allow us to use a standard Reloadable interface for all reloadable types.
And use agent.configReloaders for config reloading
e1b6b99
to
ca015bc
Compare
return apiServer{ | ||
Protocol: "dns", | ||
Addr: addr, | ||
Run: srv.ListenAndServe, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will need to log the error from ListenAndServe
, otherwise we won't see it until Shutdown
.
Closing as this is over two years old. |
This PR continues the work done in #8234 to ensure that the agent shuts down if one of the long running servers fails, instead of continuing in a degraded state. This is very likely even more important for the DNS server because if a process manager is checking the health of the Consul Agent, it may be doing so with the HTTP API, and wouldn't necessarily noticed if the DNS server had failed.