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

agent: move DNSServer to apiServers #8623

Closed
wants to merge 2 commits into from

Conversation

dnephin
Copy link
Contributor

@dnephin dnephin commented Sep 4, 2020

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.

@dnephin dnephin added theme/internal-cleanup Used to identify tech debt, testing improvements, code refactoring, and non-impactful optimization theme/dns Using Consul as a DNS provider, DNS related issues labels Sep 4, 2020
@dnephin dnephin requested a review from a team September 4, 2020 23:14
Comment on lines -680 to -731
a.logger.Info("Started DNS server",
"address", addr.String(),
"network", addr.Network(),
)
Copy link
Contributor Author

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

Comment on lines +662 to +714
// 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
Copy link
Contributor Author

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.

@dnephin dnephin mentioned this pull request Sep 16, 2020
15 tasks
Base automatically changed from dnephin/better-impl-of-TestAgent.HTTPAddr to master September 17, 2020 15:48
@mikemorris mikemorris added this to the 1.9.0 milestone Nov 18, 2020
@dnephin dnephin modified the milestones: 1.9.0, 1.9.x Nov 19, 2020
@mikemorris mikemorris removed this from the 1.9.x milestone Apr 14, 2021
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
@dnephin dnephin force-pushed the dnephin/move-dns-server-to-apiServers branch from e1b6b99 to ca015bc Compare May 21, 2021 22:43
@vercel vercel bot temporarily deployed to Preview – consul May 21, 2021 22:43 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 21, 2021 22:43 Inactive
@dnephin dnephin added the pr/no-changelog PR does not need a corresponding .changelog entry label May 21, 2021
return apiServer{
Protocol: "dns",
Addr: addr,
Run: srv.ListenAndServe,
Copy link
Contributor Author

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.

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@jmurret
Copy link
Contributor

jmurret commented May 9, 2023

Closing as this is over two years old.

@jmurret jmurret closed this May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-changelog PR does not need a corresponding .changelog entry theme/dns Using Consul as a DNS provider, DNS related issues theme/internal-cleanup Used to identify tech debt, testing improvements, code refactoring, and non-impactful optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants