Restore down nameservers after they come back online #8847
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch ensures that a previously down DNS will be used again by ATS
after connectivity to it is restored. Before this patch, we would try to
reconnect to it after one attempt at DNS_PRIMARY_RETRY_PERIOD, but not
again after.
For review
Calling
DNSHandler::mainEventwill attempt to reconnect to the name server if it had been previously marked as down. Before this patch, calling this was done via a set ofschedule_incalls which didn't result in it being called regularly. It was called once, but then not again after that. This simplifies the logic by periodically callingmainEventevery 5 seconds over the lifetime of ATS which will, if needed, retry any down name servers. This is the purpose of the newschedule_everybeing added instartEventwhich replaces the variousschedule_incalls in other code paths. This guarantees that we will re-inspect any down name servers every 5 seconds.