Repository navigation
Conversation
A running host read config.json only at start: an outside edit applied at the next restart and blocked console saves on the ETag mismatch until then. SIGHUP now reloads the file on a running host. Validation is all-or-nothing (strict parse, cross-key checks, schema_version equality, host binding); on adoption the settings ETag advances to the file hash. Keys with a live path take effect with the console save's side effects, network.permitted and both console-domain lists reconcile the way a start would, restart-required keys are adopted but apply at the next start, and run overrides and legacy pins survive. Reloads hold the settings lock against console saves, coalesce, and Close waits out an in-flight reload before teardown. Spec: docs/spec/config-reload.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.
Reload config.json on SIGHUP
A running host read
config.jsononce at start. An operator who edited thefile directly had to restart the host, and until then the console refused
settings saves because the file's hash no longer matched the settings ETag.
SIGHUP now reloads the file on a running host, without interrupting serving:
checks,
schema_versionequality in either direction, and the host binding(
host.instance_id/host.data_dirnever change on a live host). Arefused reload keeps the current settings and ETag and logs the reason.
saves work again.
save (rate limit push, quota enforcement,
portal.hide, proxy template,external origins, default providers, preferred console).
network.permittedand both console-domain lists reconcile the way thenext start would: added providers record their grant and start their
backend, removed providers lose their routes while flats keep their
permissions, and console domains are served or retired accordingly.
host.*,metrics.*,portal.relays, …) areadopted and logged as awaiting a restart; run overrides and legacy flag
pins keep their running values.
and
Closewaits out an in-flight reload before teardown.New spec:
docs/spec/config-reload.md(the key table indocs/configuration.mdnow names the reload path where it applies).Verification
go test ./... -count=1: all packages pass except the pre-existing,environment-caused
internal/launchdTestPlistContent(macOSplutilon a Linux host; fails identically on clean
main).internal/coreandinternal/app, includingadoption and ETag advance, refusal paths (invalid JSON, schema mismatch
both directions, host binding), rate-limit push, pins and run overrides,
provider add/remove reconcile, both console-domain reconciles, signal
coalescing, reload/save serialization, post-adoption side-effect failure,
and
Closewaiting out an in-flight reload (with a demonstratedfail-without-fix check).
-raceclean on the reload tests.kill -HUP, liveapplication, console save unblocked, invalid file refused while serving,
restart-required key logged and not applied.
Review record (development protocol)
Design, implementation and testing each passed adversarial review by an
eligible different model (author:
kimi-code/k3; reviewer:claude-sonnet-4-5, effective identity from CLI execution metadata):accepted by the reviewer; final: "No blocking defects found.")
re-verified).
closed with new tests) and a rebuttal round where the reviewer withdrew
its finding after verifying the diff evidence ("The implementation
approval carries forward to snapshot be268a27").
Full task report with receipts: local-only at
~/.local/share/flats-dev/sighup-config-reload/task-report-final.md(not accessible to remote reviewers; verdicts are quoted above).
Known coverage limits: real signal delivery is verified manually only;
Tailscale/NetBird reconcile paths use test seams, not live networks.