upwatch: hold a seeding torrent app for one line test, then put its limit back exactly (R-1250)
gates / gates (push) Successful in 1m22s

When the agent waits for quiet and qBittorrent or Transmission runs: record the limit first,
hold at 1 KiB/s, ask the agent for a test on request, put the old limit back (deferred; a
household change during the test stays). Start-up puts back a limit a killed controller left;
the 50 % rule skips while a hold record exists. Commit only.
This commit is contained in:
admin committed 2026-10-24 13:19:07 +02:00
1 parent bddc477e22
commit 046b808792
10 files changed
+789 -33

No files matched your search

+24
View File
@@ -1,3 +1,27 @@
## Unreleased (next: v0.343.0) — the line test for a box that seeds all day (R-1250) (2026-10-24) — committed, not released
**MinAgent: 0.158.1** (unchanged): an agent before 0.165.0 never reports `waiting_for_quiet`, so nothing is held. Attended
brief 2026-10-24, Part 4 (commit only; the release rides the next normal train). Design: felhom.eu `08` §9.
- **`internal/upwatch/linehold.go`** — when the agent says a test is due and waits only for quiet, and qBittorrent (or
Transmission) runs: read the app's upload limit exactly as it stored it, write the record
`upwatch.line_test_hold` FIRST, hold the app at 1 KiB/s (Transmission: 1 kB/s, limit on), call the agent's
`POST /host/line-test/run` (about 55 s), then put the old limit back — the household's own included — and clear the
record. The release is deferred (a panic puts it back too); a hold whose write failed is undone before anything else;
a household change made during the test stays; an app that cannot be read keeps the record, and no new hold starts
until it is put back. `startUpwatch` puts back a limit a killed controller left (`RecoverHold`) before any rule runs,
and each 15-minute tick runs the hold before qBittorrent's 50 % rule, which skips while a record exists (it would
read 1 KiB/s as the household's change and stop for good).
- **`agentapi.LineTestRun`** + `LineTestState.WaitingForQuiet`; `postSlow` gives one call its own timeout (2 min) on the
pinned transport — the client's 15 s would cut the 55 s answer.
- **Transmission**: `rpc` (Basic auth + the session-id handshake) shared by `Ask` and the new `ReadLimit`/`WriteLimit`
(`session-get`/`session-set` of `speed-limit-up` + `speed-limit-up-enabled`); a `result` other than success is an error.
- Tests (each seen failing): `TestHold_PutsTheHouseholdsLimitBackExactly` (measured, failed, refused, agent unreachable),
`…PutsBackNoLimit`, `…StartupPutsBackALimitLeftHeld`, `…APanicInTheTestStillPutsTheLimitBack`,
`…AHouseholdChangeDuringTheTestStays`, `…AFailedHoldIsUndoneAndNoTestRuns`, `…AnUnreachableAppKeepsTheRecordUntilItIsBack`,
`…OnlyWhenTheAgentWaitsAndAnAppRuns`, `…QBLimitRuleSkipsAHeldLimit`, `…TheTwoAppsReadAndWriteTheirLimit`,
`TestLineTestRunOutlastsTheClientTimeout`, `TestStartUpwatchRecoversTheHoldFirst`, `TestUpwatchHoldGetsBothAgentCalls`.
## v0.342.0 (2026-10-24) — RELEASED on the operator's yes (attended release run; image sha256:d002d3b7…, from `42cda07`, CI 2283) — the upload and CPU watch, the tested line and qBittorrent's limit
**MinAgent: 0.158.1** (unchanged). **Hub dependency:** the four new event types need hub 0.169.0 (committed the same