optimize dns propagation request #22375
Closed
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.
Currently the DNS propagation request has a heavy and unnecessary bottleneck. Under the hood the route53 waiter stays in a thread blocking loop checking a single entry every 30 seconds over 60 attempts. Check out the source code here. The current implementation makes a single change, then waits for the propagation to finish before making the second change. AWS averages around 60 seconds for propagation, which means the current implementation takes about (60s)n, increasing by 60-90 seconds for each entry that needs to be changed, potentially creating very long wait times
This is a simple optimization extracted from a previous PR #22360 and discussed with @fjl to make all of the DNS changes first, and only after, wait for the response for each one. This improves the time complexity to roughly (60s)1. If I had 3 changes to make, the original implementation would take around 3-4 minutes. The new implementation bundles the changes together so the operation should now take ~60-90 seconds total, and would not increase dramatically with more changes