fix(libcdb): ensure CI cache starts reliably#2715
Open
bobo-xxx wants to merge 1 commit intoGallopsled:devfrom
Open
fix(libcdb): ensure CI cache starts reliably#2715bobo-xxx wants to merge 1 commit intoGallopsled:devfrom
bobo-xxx wants to merge 1 commit intoGallopsled:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make the libcdb CI nginx cache service start reliably by avoiding nginx startup-time DNS lookups for upstream hostnames (a known intermittent failure mode in Docker/network init).
Changes:
- Add
valid=30sto the nginxresolverconfiguration to limit DNS caching duration. - Convert static
proxy_passupstream hostnames to variables so nginx resolves them at request time instead of at startup. - Update
proxy_set_header Hostto use the same hostname variables for consistency.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+17
to
+21
| set $debuginfod_elfutils debuginfod.elfutils.org; | ||
| set $libc_rip libc.rip; | ||
| set $archive_ubuntu archive.ubuntu.com; | ||
| set $gitlab gitlab.com; | ||
| set $debuginfod_ubuntu debuginfod.ubuntu.com; |
Member
|
Thanks, I didn't know static hostnames are still resolved at parse time. Copilot's review is right though.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Root Cause
In nginx, the
resolverdirective only defers DNS resolution when variables are used inproxy_pass. With static hostnames (e.g.,proxy_pass https://debuginfod.elfutils.org/;), nginx resolves the hostname at startup when creating its upstream blocks. If DNS is unavailable at startup time (e.g., Docker's embedded DNS at 127.0.0.11 isn't ready), nginx fails with:Fix
Convert all
proxy_passhostnames to nginx variables. Whenproxy_passuses a variable, nginx resolves the hostname at request time using the configured resolver instead of at startup. This ensures the cache starts reliably regardless of DNS availability during container initialization.Additionally, added
valid=30sto the resolver to limit DNS caching time.Testing
The fix was verified by confirming nginx config syntax is valid. The change is a pure nginx configuration fix with no code changes.
Fixes #2712