maintenance_mode is configurable and reported by the healthcheck but does not affect any request #71
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Verified against
mainat61f42e6.maintenance_modeis a real config key (config.example.yml:6,internal/config/config.go:38,103), it is reported in the healthcheck JSON (internal/healthcheck/healthcheck.go:79), andServer.MaintenanceMode()exists (internal/server/server.go:148-151).Server.MaintenanceMode()has no callers — grep acrossinternal/andcmd/finds only the definition and test references. No route, middleware, or handler consults it.So turning on maintenance mode changes exactly one thing: the healthcheck JSON says
true. Every request is still served normally. An operator who sets it believing traffic will be drained gets no such behavior, silently — the failure mode is that they find out during the maintenance they were trying to perform.Definition of done
maintenance_modeis true, image-serving routes return503 Service Unavailablewith aRetry-Afterheader and the standard JSON error body used elsewhere./metricslikewise — decide deliberately and state the choice in the PR./,/generate) stays available during maintenance; recommend yes, so an operator can still work.internal/server/routes.gorather than a check sprinkled through handlers.Retry-After, and the healthcheck still returns 200 reportingmaintenance: true.make checkgreen.Alternative
If maintenance mode is only ever meant as a signal for an external load balancer to drain, then the code is already correct and the gap is documentation. In that case: document it in
README.mdandconfig.example.ymlas advisory-only, and remove the unusedServer.MaintenanceMode()accessor. Pick one — the current state (a real-looking accessor nobody calls) reads as an unfinished feature.