You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe4ae50
Browse filesBrowse the repository at this point in the historyBrowse files
docs(issues): [#2505] correct the contract, origin, and AC4 statements
The inherent get_banned_ips_total had no doc comment, so the spec's
contracts-violated bullet, scope, and AC3 now say the fix adds one and
updates the reset_bans doc. Date the method from 1ce2e33 (#1145), not the
package extraction, and note that the value was wrong since the metric was
introduced. Make the AC4 evidence say that no code reference remains.
Addresses late PR #2506 review findings F7 and F9 and PR #2524 review
finding F4 by Cameron.
Co-authored-by: Copilot <[email protected]>
-`udp-server``Metrics::udp_banned_ips_total` doc: "Total number of banned IPs."
@@ -125,8 +128,12 @@ named `it_should_publish_the_distinct_client_ip_total_after_a_connection_cookie_
125
128
### Origin
126
129
127
130
Found while planning `packages/udp-core/src/services/banning.rs` tests in Issue #1348 (EPIC #1347).
128
-
`get_banned_ips_total` dates from the package extraction (`1886593b4`, 2025-02-18); the trait
129
-
wrapper came with `637c17b18` (2026-06-23).
131
+
`get_banned_ips_total` was added with its current body (`self.accurate_error_counter.len()`) by
132
+
`1ce2e3327` (`feat: [#1145] add banned ips total for UDP to stats`, 2025-01-07), in
133
+
`src/servers/udp/server/banning.rs`; the package extraction (`1886593b4`, 2025-02-18) only moved
134
+
the file. So the value has been wrong since the metric was introduced. The trait wrapper came with
135
+
`637c17b18` (2026-06-23). (Corrected after PR #2506 review finding F9; an earlier version dated the
136
+
method from the extraction.)
130
137
131
138
## Decision: Meaning of "Banned" When Validation Is `disabled`
132
139
@@ -149,7 +156,10 @@ field. The documentation listed under "Contracts violated" must state the `disab
149
156
- Make `BanService::get_banned_ips_total()` return the number of IPs whose error count exceeds the
150
157
limit, in both `strict` and `disabled` mode.
151
158
- Update the gauge when bans are reset, so it never reports a stale total.
152
-
- Fix the documentation listed under "Contracts violated" to match decision A.
159
+
- Fix the documentation listed under "Contracts violated" to match decision A: add a doc comment
160
+
to the inherent `BanService::get_banned_ips_total` (the threshold and the `disabled`-mode
161
+
meaning), update the `BanService::reset_bans` doc, and correct the metric, `Metrics`, and REST
162
+
field descriptions.
153
163
- Remove the unused `BanningStats` trait and its implementation.
154
164
- Remove the write-only `BanService::last_connection_id_errors_reset` field.
155
165
- Adjust the `udp-server` unit tests that pin the old value, keeping their intent:
@@ -569,15 +579,23 @@ scope (`udp-core`, `udp-server`), signed with GPG.
569
579
states the measure and the 5.1% figure, and says that attributing the P2 excesses to the counter
570
580
or to noise rests on the same-machine comparison, not on the P1/P2 tables. AC5's conclusion is
571
581
unchanged.
582
+
- 2026-10-14 10:03 UTC - GitHub Copilot (implementation session) - Late PR #2506 review (Cameron, findings
583
+
F7 and F9, handled on this branch with maintainer approval
584
+
<https://github.com/torrust/torrust-tracker/pull/2506#issuecomment-6165699972>) and PR #2524
585
+
finding F4 by Cameron: corrected the "Contracts violated" bullet (the inherent method had no doc
586
+
comment), Scope, AC3, and its evidence row; dated `get_banned_ips_total` from `1ce2e3327` (#1145)
587
+
and noted in "Risks and Trade-offs" that the value was wrong since the metric was introduced; and
588
+
made the AC4 evidence say that no code reference remains, keeping the open EPIC's history row.
572
589
573
590
## Acceptance Criteria
574
591
575
592
-[x] AC1: The banned-IPs total counts only IPs whose error count exceeds the limit, in both `strict`
576
593
and `disabled` mode (R1, R1p, R5, R6, M1-M3).
577
594
-[x] AC2: After a ban reset, the banned total and the published gauge report the new value (R2, R3,
578
595
R4, M4).
579
-
-[x] AC3: The method, metric, `udp-server` helper, and REST field descriptions match the behavior,
580
-
including the `disabled`-mode meaning.
596
+
-[x] AC3: The inherent `BanService::get_banned_ips_total` has a doc comment, and it, the
597
+
`BanService::reset_bans` doc, the metric, the `udp-server` helper, and the REST field descriptions
598
+
match the behavior, including the `disabled`-mode meaning.
581
599
-[x] AC4: The `BanningStats` trait and `BanService::last_connection_id_errors_reset` are removed.
582
600
-[x] AC5: `performance-evidence.md` records the P1 baseline and the P2 after measurements
583
601
(Criterion, including `udp_ban_service/record_error`, and `aquatic_udp_load_test`), and P2 meets
| AC1 | DONE | R1, R1p, R5, R6 green and proven (manual-verification-evidence.md "Regression Tests"); M1-M3 after fix 0, 0, 1 |
646
664
| AC2 | DONE | R2, R3, R4 green and proven; M4 after fix 0 right after the reset |
647
-
| AC3 | DONE |`docs(udp-server): [#2505] describe the banned-IPs metric as IPs over the limit`; `BanService::get_banned_ips_total` doc in the `udp-core` fix|
648
-
| AC4 | DONE |`fix(udp-core): [#2505] count only IPs over the limit as banned`; no reference remains outside archived docs |
665
+
| AC3 | DONE |`docs(udp-server): [#2505] describe the banned-IPs metric as IPs over the limit`; the new `BanService::get_banned_ips_total` doc comment and the updated `reset_bans` doc in `fix(udp-core): [#2505] count only IPs over the limit as banned`|
666
+
| AC4 | DONE |`fix(udp-core): [#2505] count only IPs over the limit as banned`; no code reference remains. The open EPIC (`docs/issues/open/1669-overhaul-packages/EPIC.md`, SI-30 row) still names `BanningStats` as an SI-30 deliverable, which records history and stays as is.|
649
667
| AC5 | DONE (accepted deviation) |`performance-evidence.md` "Comparison": load test passes; 9 Criterion medians over the limit, accepted by the maintainer |
650
668
| AC6 | DONE | manual-verification-evidence.md "Final Recheck on the Finished Code (T10)" (F-V1 to F-V4 on the final code) |
651
669
| AC7 | DONE |`record_error` P2 medians flat across 10 to 10,000 tracked IPs; B1 check shows a scan would grow linearly |
652
670
653
671
## Risks and Trade-offs
654
672
655
-
-**Dashboards built on the inflated value will drop.** Mention it in the PR and release notes.
673
+
-**Dashboards built on the inflated value will drop.** The value has been inflated since the metric
674
+
was introduced (#1145), so every release that reports it is affected. Mention it in the PR and
675
+
release notes.
656
676
Operators who want "IPs that sent an invalid connection ID" lose that number; the existing
657
677
counter `udp_tracker_server_connection_id_errors_total` still reports the error volume.
658
678
-**Per-error cost.** See "Performance Alternatives"; the benchmark guards against regressions.
0 commit comments