Add configuration for graceful shutdown of application services - #935
Open
eseliger wants to merge 2 commits into
Open
Add configuration for graceful shutdown of application services#935eseliger wants to merge 2 commits into
eseliger wants to merge 2 commits into
Conversation
eseliger
force-pushed
the
syntax-highlighter-termination-grace
branch
from
August 29, 2026 23:38
5b7af16 to
b5327c7
Compare
eseliger
force-pushed
the
syntax-highlighter-termination-grace
branch
from
August 29, 2026 23:39
b5327c7 to
b077f1e
Compare
Add global and per-service controls for the standard Sourcegraph pre-shutdown pause, total graceful shutdown timeout, and Kubernetes termination grace period. Syntax-highlighter uses the longer 5s/40s/45s profile required for large highlighting requests. Cloud rollout notes: canary the released syntax-highlighter image first. Verify the rendered 45-second grace period and image digest, EndpointSlice transition timing, stabilizer shutdown logs, and zero terminal Frontend failures before rolling out to sourcegraph.com. Keep replica-count changes separate; sourcegraph.com already runs two replicas. Amp-Thread-ID: https://ampcode.com/threads/T-01a04e71-0f57-74a8-91db-36cc3c22d05d
eseliger
force-pushed
the
syntax-highlighter-termination-grace
branch
from
August 29, 2026 23:57
b077f1e to
59f215f
Compare
eseliger
marked this pull request as ready for review
August 30, 2026 00:02
…rmination-grace Amp-Thread-ID: https://ampcode.com/threads/T-01a04e71-0f57-74a8-91db-36cc3c22d05d # Conflicts: # charts/sourcegraph/CHANGELOG.md
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.
Sourcegraph application services need an explicit shutdown contract so Kubernetes leaves enough time for endpoint propagation, request draining, and process cleanup. The chart currently relies mostly on implicit Kubernetes defaults and requires operators to know internal environment variable names.
This adds global chart settings:
sourcegraph.preShutdownPause(default5s), rendered asSRC_PRE_SHUTDOWN_PAUSEsourcegraph.gracefulShutdownTimeout(default15stotal, including the pause), rendered asSRC_GRACEFUL_SHUTDOWN_TIMEOUTsourcegraph.terminationGracePeriodSeconds(default30)Frontend, Gitserver, Searcher, Worker, precise and syntactic code-intel workers, and syntax-highlighter inherit these settings. Each supports a service-level override using the same value name. Existing explicit entries in a service's
envmap take precedence, preserving current configurations.The common timeline is:
Test plan
helm lint charts/sourcegraphhelm unittest -q charts/sourcegraph(122 tests)envprecedence, worker replicas.