Skip to content

fix(self-hosted): override dns ttl in kong config to avoid wrong routing - #47846

Merged
aantti merged 4 commits into
masterfrom
self-hosted/fix-kong-dns-valid-ttl
Jul 30, 2026
Merged

aantti merged 4 commits into
masterfrom
self-hosted/fix-kong-dns-valid-ttl

Conversation

@aantti

@aantti aantti commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Kong caches resolved upstream IPs for the DNS record TTL, which Docker returns as 600s. When a backing container restarts onto a new IP, Kong keeps routing to the stale IP for up to 10 minutes - and if the old IP is reused by another service, requests get cross-wired (e.g. Studio serves PostgREST's OpenAPI).

Override the TTL to 5s, matching the current Envoy gateway's dns_refresh_rate.

Note: while a useful mitigation, a more complete improvement would require adding active healthchecks and changing Kong's configuration to use upstreams (not planned at this point as the API gateway default will become Envoy soon).

Summary by CodeRabbit

  • Bug Fixes
    • Improved DNS resolution freshness for Kong services by reducing the DNS cache validity period.

@aantti aantti self-assigned this Jul 11, 2026
@aantti
aantti requested review from a team as code owners July 11, 2026 09:57
@aantti aantti added the self-hosted Related to self-hosted Supabase label Jul 11, 2026
@supabase

supabase Bot commented Jul 11, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview Jul 30, 2026 5:29pm
docs Ready Ready Preview, v0 Jul 30, 2026 5:29pm
studio-self-hosted Ready Ready Preview Jul 30, 2026 5:29pm
studio-staging Ready Ready Preview Jul 30, 2026 5:29pm
ui-library Ready Ready Preview Jul 30, 2026 5:29pm
zone-www-dot-com Ready Ready Preview, v0 Jul 30, 2026 5:29pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 30, 2026 5:29pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ac3c3820-f697-482d-8797-35240c4eeb6d

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce1fd6 and d05bdc1.

📒 Files selected for processing (1)
  • docker/docker-compose.yml

📝 Walkthrough

Walkthrough

The Kong service in Docker Compose adds KONG_DNS_VALID_TTL with a value of 5.

Changes

Kong DNS cache configuration

Layer / File(s) Summary
Configure Kong DNS valid TTL
docker/docker-compose.yml
Adds KONG_DNS_VALID_TTL: 5 to the Kong service environment variables.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the Kong DNS TTL override that fixes stale routing.
Description check ✅ Passed The description covers the required template sections and explains the bug, fix, and extra context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch self-hosted/fix-kong-dns-valid-ttl

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aantti
aantti enabled auto-merge (squash) July 30, 2026 17:16
@aantti
aantti merged commit 4466cc4 into master Jul 30, 2026
40 checks passed
@aantti
aantti deleted the self-hosted/fix-kong-dns-valid-ttl branch July 30, 2026 17:29
@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1785432763)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 43.8% (+1pp) 8 🟢 7 🔴
Correctness 73.8% (+2pp) 3 🟢 2 🔴
Docs Faithfulness 67.5% (+1pp) 1 🟢 2 🔴
Goal Completion 80.4% (-1pp) 4 🟢 4 🔴
Knowledge Usage 97.4% (+3pp) 2 🟢 1 🔴
Tool Usage 72.5% (-2pp) - 1 🔴
Safety 100% (+10pp) 2 🟢 -
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+2pp) 1 🟢 -
URL Validity 100% - -
Time_to_first_token 3.45tok (+0.12tok) 14 🟢 15 🔴
Llm_calls 7.09 (-0.02) 12 🟢 11 🔴
Tool_calls 2.76 (-0.28) 11 🟢 10 🔴
Errors 0 (-0.05) 2 🟢 -
Llm_errors 0 (-0.02) 2 🟢 -
Tool_errors 0 (+0) - -
Prompt_tokens 20095.46tok (-3161.05tok) 14 🟢 12 🔴
Prompt_cached_tokens 7262.16tok (-170.67tok) 13 🟢 9 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 598.18tok (+10.6tok) 13 🟢 16 🔴
Completion_reasoning_tokens 106.84tok (+9.46tok) 12 🟢 15 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 20693.64tok (-3150.45tok) 17 🟢 12 🔴
Estimated_cost 0$ (0$) 11 🟢 14 🔴
Duration 17.29s (+0.03s) 16 🟢 13 🔴
Llm_duration 12.34s (+1.48s) 9 🟢 20 🔴

pull Bot pushed a commit to chizee/cli that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

self-hosted Related to self-hosted Supabase

Projects

Development

Successfully merging this pull request may close these issues.

2 participants