Repository navigation
docs(self-hosting): explain how Edge Functions workers are reused across requests - #53996
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
alexisintech
marked this pull request as ready for review
November 25, 2026 01:52
alexisintech
marked this pull request as draft
November 25, 2026 02:22
alexisintech
marked this pull request as ready for review
November 25, 2026 02:22
alexisintech
approved these changes
Nov 25, 2026
This was referenced Nov 25, 2026
alexisintech
added a commit
that referenced
this pull request
Nov 25, 2026
…DOCS-1805) (#54080) ## Problem The self-hosted docs have an owner on the self-hosted team, but `.github/CODEOWNERS` gives all of `/apps/docs/` to `@supabase/docs` alone. A change to a self-hosted page doesn't request a review from the people who own that content. [#53996](#53996) merged that way, and [#54013](#54013) followed up on it. Closes [DOCS-1805](https://linear.app/supabase/issue/DOCS-1805/request-a-self-hosted-review-on-each-self-hosted-docs-pr) ## Solution The self-hosted docs pages are owned by `@supabase/docs` and `@supabase/self-hosted`, the team that already owns `/docker/`. Two patterns cover them: - `apps/docs/content/guides/self-hosting*`: the `self-hosting/` folder and `self-hosting.mdx` - `apps/docs/content/guides/**/*self-hosted*`: any guide whose file name contains `self-hosted`, such as `grafana-self-hosted.mdx` and `expose-self-hosted-queues.mdx`, in `.mdx` or `.md` The last matching line in CODEOWNERS wins, so the new lines sit after `/apps/docs/` and keep `@supabase/docs` as an owner. A PR that changes one of these pages requests a review from both teams. ## Review instructions 1. Check that GitHub reports no CODEOWNERS errors: `gh api "repos/supabase/supabase/codeowners/errors?ref=alexisa/DOCS-1805"` returns `"errors": []`. 2. Check which files the two patterns match. They follow `.gitignore` rules, so `git check-ignore` can list the matches: ```bash printf '/apps/docs/content/guides/self-hosting*\n/apps/docs/content/guides/**/*self-hosted*\n' > /tmp/co.ign git ls-files apps/docs | git -c core.excludesFile=/tmp/co.ign check-ignore --no-index --stdin ``` The list has 25 files: the `self-hosting/` pages, `self-hosting.mdx`, and the guides with `self-hosted` in the name. 3. After merge, open a PR that changes a self-hosted page, and check that GitHub requests a review from `@supabase/self-hosted`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide). Doesn't apply: this PR changes only CODEOWNERS.
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.
Problem
The self-hosted Functions guide lists worker timeouts and idle cleanup, but never says that a running worker serves later requests. The Docker guide says the main worker loads each function from disk per request, which suggests top-level setup runs on every request.
Related to FDBKIN-22732
Closes DOCS-1799
Solution
A new "Worker lifecycle" section on the self-hosted Functions guide explains that the default
per_workerpolicy sends requests to a function's running workers. Concurrent cold requests can start up to one worker per CPU, and later requests rotate across them. It says that top-level code runs once per worker, so heavy setup belongs there. It also lists the events that stop a worker from taking new requests, including retirement at half ofworkerTimeoutMs, links to the existing timeout and cleanup sections, and names the settings that keep workers alive longer. The Docker guide's sentence now says that a restart stops running workers, so the next request picks up changed code.How to verify
workerTimeoutMs, no requests, idle-worker cleanup, an error or resource limit, and a service restart as events that stop a worker from taking new requests, and says a new worker starts when the function has none left. The links to Timeout errors, Idle-worker cleanup, Per-worker memory limit, and Container memory budget go to those sections.requestAbsentTimeoutMsandworkerTimeoutMsas the settings to raise to keep workers alive longer.Checks
Ran
pnpm turbo run lint typecheckon the changed packages andpnpm exec oxfmt --checkon the changed files. Checked the facts againstdocker/volumes/functions/main/index.tsanddocker/docker-compose.ymlin this repo, and againstsupabase/edge-runtimeatv1.79.2(the compose image tag):cli/src/flags.rs(--policydefault),crates/base/src/worker/pool.rs(worker reuse, rotation, concurrent creation, and retirement),crates/base/src/worker/supervisor/strategy_per_worker.rs(early retirement at half of the wall-clock limit), andext/workers/user_workers.js(forceCreatedefault). Docs tests need Docker and were skipped. Reuse wasn't tested against a running stack.Checklist
Feedback for Tedd
To ask Tedd for a change to this PR, reply in Tedd's session on DOCS-1799. Tedd doesn't read comments on this PR.