Repository navigation
fix(server): guard concurrent collector runs, report stale devices, optional auto-archive - #975
Merged
Merged
Conversation
…llector POST /api/collectors/run now returns 409 while a run is active and iterates omnibus.CollectorSpecs, so btrfs, filesystem and performance run too. The endpoint stays in the existing protected route group; WP-H scopes should require admin for it. BREAKING CHANGE: a second POST /api/collectors/run issued while a run is in progress now returns 409 instead of starting an overlapping run.
…rchive /api/summary now includes last_seen and stale per device, computed with the same last-seen data and timeout rules (per-device override, else the global missed ping timeout) as the missed ping monitor. Devices dropped by a failed smartctl --info scan stop reporting and become stale like any silent device. web.devices.auto_archive_stale_days (default 0, off) archives devices not seen for that many days through the existing device archive path.
10 of 14 tasks
…st-seen Move the missed ping timeout default into Device.MissedPingTimeout so a zero global value no longer marks every device stale. Make stale a nullable field so a failed last-seen query is distinguishable from not stale, and cache last-seen data for 30s. Auto-archive now honors the per-device timeout, warns when the configured days are below the global timeout, and sends a notification; the docs state that auto-archived devices stay archived until unarchived manually. Restore the web.reports.path comment placement.
3 of 14 tasks
This was referenced Oct 13, 2026
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.
Summary
WP-E (server operations) for the 2.0.0 release. On-demand collector runs can no longer overlap and now run every bundled collector, and
/api/summaryreports when each device last reported and whether it is stale, with optional auto-archiving of devices that stop reporting.Type of Change
Related Issues
Related to #965. Addresses #533.
Changes Made
POST /api/collectors/run: a request while a run is active returns 409 (breaking footer on 39bd9bc). The handler iterates the sharedomnibus.CollectorSpecs, so btrfs, filesystem, and performance collectors also run; binaries missing from PATH are skipped. Route group unchanged; admin scope comes with the API token work./api/summary(plain and paginated): per devicelast_seen(omitted when the device never reported) andstale(omitted when last-seen data could not be loaded), computed with the same rule the missed-ping monitor uses (newmodels.Device.MissedPingTimeoutandIsStale, now shared by both). Archived and never-seen devices are never stale. Works whether or not missed-ping notifications are enabled. A 0 or negative global timeout falls back to the 60-minute default, as in the monitor. Muted devices still report stale. Last-seen data is cached for 30 seconds; a query failure is logged and leaves both fields unset rather than failing the summary.web.devices.auto_archive_stale_days(config file, default 0 = off): the monitor tick on the leader archives devices silent for longer thanmax(days, the device's missed-ping timeout)through the existing archive path, removes them from MQTT, and sends one notification per tick listing them. Never-seen devices are skipped. Auto-archived devices stay archived until unarchived manually. A startup warning is logged when the setting is shorter than the global missed-ping timeout.docs/openapi.yaml(summary fields) andexample.scrutiny.yaml(new setting).Testing
go build ./...,go vet ./...,go test ./...,go test -raceonweb,web/handler,models;golangci-lint run --new-from-rev=origin/beta(v2.14.0, linux/amd64) 0 issues. Tests: concurrent run returns 409, all available collectors invoked, stale rule with per-device override, summary fields, auto-archive.Checklist
Notes
auto_archivedflag (so a returning device could be unarchived automatically) needs a migration; deferred to the migration work.smartctl --info(fix(collector): skip unidentified devices, add exclude list and bounded parallel collection #969) goes stale only if it already has history; that path is not covered by a dedicated test.Review: not required (server change on the
betaintegration branch; an independent read-only review is being run per release coordination)