Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ deny = [
"torrust-tracker-axum-http-server",
"torrust-tracker-client-lib",
"torrust-tracker-http-core",
"torrust-tracker-test-helpers",
] },
{ crate = "torrust-tracker-udp-protocol", wrappers = [
"torrust-tracker-client-lib",
"torrust-tracker-test-helpers",
"torrust-tracker-udp-core",
"torrust-tracker-udp-server",
] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ github-issue: 2035
spec-path: docs/issues/open/2035-fix-duplicate-port-zero-tracker-instance-bootstrap/ISSUE.md
branch: 2035-fix-duplicate-port-zero-tracker-instance-bootstrap
related-pr: null
last-updated-utc: 2026-07-29 16:51
last-updated-utc: 2026-07-29 18:14
semantic-links:
skill-links:
- write-unit-test
Expand All @@ -21,6 +21,7 @@ semantic-links:
- docs/issues/open/2041-migrate-runtime-service-registry-metadata/ISSUE.md
- docs/events-architecture.md
- evidence.md
- tests/aggregate_stats_fixed_ports.rs
related-issues:
- 1419
- 2036
Expand Down Expand Up @@ -61,6 +62,9 @@ The local reproduction is recorded in [evidence.md](evidence.md).
- Include the configuration instance index in HTTP and UDP bootstrap lifecycle logs, including
events that report configured and final bound addresses.
- Add regressions with repeated `0.0.0.0:0` blocks whose configuration differs.
- Add fixed-port HTTP statistics coverage that proves a disabled listener does
not contribute after it receives its own configuration. Keep aggregate
statistics coverage for repeated port-zero bindings deferred until #2039.

### Out of Scope

Expand Down Expand Up @@ -94,15 +98,17 @@ only for this issue's metrics-related final verification and closure.

## Implementation Plan

| ID | Status | Task | Notes / Expected Output |
| --- | ------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| T1 | DONE | Land [#2036](../2036-add-runtime-service-registry-metadata/ISSUE.md) canonical identity | Bootstrap identity aligns with the canonical runtime identity contract. |
| T2 | TODO | Replace address-keyed container lookup | Use an order-preserving representation or canonical identity, not configured `SocketAddr`. |
| T3 | TODO | Start matching containers | Pass each configuration entry's matching container into HTTP and UDP startup. |
| T4 | TODO | Correlate lifecycle logs | Include canonical identity with configured and final binding logs. |
| T5 | TODO | Add bootstrap regressions and validate | Cover duplicate port-zero HTTP/UDP listeners and record focused verification. |
| T6 | BLOCKED | Land registry metadata migration | #2041 must expose started-service canonical identity before final verification. |
| T7 | BLOCKED | Land [#2039](../2039-normalize-per-instance-event-metrics-policy/ISSUE.md) event-metrics normalization | Required only for metrics-related final verification and issue closure. |
| ID | Status | Task | Notes / Expected Output |
| --- | ------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| T1 | DONE | Land [#2036](../2036-add-runtime-service-registry-metadata/ISSUE.md) canonical identity | Bootstrap identity aligns with the canonical runtime identity contract. |
| T2 | DONE | Replace address-keyed container lookup | Use an order-preserving representation or canonical identity, not configured `SocketAddr`. |
| T3 | DONE | Start matching containers | Pass each configuration entry's matching container into HTTP and UDP startup. |
| T4 | DONE | Correlate lifecycle logs | Include canonical identity with configured and final binding logs. |
| T5 | DONE | Add HTTP statistics integration coverage | In `tests/aggregate_stats_fixed_ports.rs`, added fixed-port HTTP test. Aggregate count `1` blocked by #2039 (shared HTTP event bus). |
| T6 | DONE | Add bootstrap regressions | Cover duplicate port-zero HTTP/UDP configuration-to-container correspondence without asserting aggregate metrics policy. |
| T7 | TODO | Run and record local tracker probes | Run fixed-port HTTP and duplicate-port-zero bootstrap scenarios locally; append configuration, commands, outputs, and comparisons to [evidence.md](evidence.md). |
| T8 | BLOCKED | Land registry metadata migration | #2041 must expose started-service canonical identity before final verification. |
| T9 | BLOCKED | Land [#2039](../2039-normalize-per-instance-event-metrics-policy/ISSUE.md) event-metrics normalization | Required only for deferred UDP and repeated-port-zero aggregate-statistics tests, final verification, and issue closure. |

## Progress Tracking

Expand All @@ -111,11 +117,11 @@ only for this issue's metrics-related final verification and closure.
- [x] Specification drafted and approved by user/maintainer
- [x] GitHub issue created: #2035
- [x] Prerequisite #2036 completed
- [ ] Bootstrap identity preservation completed
- [x] Bootstrap identity preservation completed
- [ ] Registry metadata migration completed
- [ ] Event-metrics normalization completed
- [ ] Final automatic and manual verification completed
- [ ] Acceptance criteria reviewed after implementation
- [x] Acceptance criteria reviewed after implementation

### Progress Log

Expand All @@ -127,31 +133,47 @@ only for this issue's metrics-related final verification and closure.
- 2026-07-29 16:51 UTC - agent - Clarified the two-phase delivery order from the #2036 handoff:
bootstrap identity propagation begins after #2036; #2041 and #2039 are required only for
metrics-related final verification and closure.
- 2026-07-29 18:14 UTC - user - Distinguished bootstrap configuration collision from UDP server aggregate
metrics filtering. Fixed-port HTTP statistics coverage belongs to this phase; UDP aggregate
statistics and repeated-port-zero aggregate statistics remain deferred to #2039.

## Acceptance Criteria

- [ ] AC1: Two HTTP tracker blocks with the same `0.0.0.0:0` binding each start with their own configuration.
- [ ] AC2: Two UDP tracker blocks with the same `0.0.0.0:0` binding each start with their own configuration.
- [ ] AC3: Bootstrap does not use configured `SocketAddr` as a unique instance identity.
- [ ] AC4: HTTP and UDP startup logs include the configuration `instance_index`, allowing logs
- [x] AC1: Two HTTP tracker blocks with the same `0.0.0.0:0` binding each start with their own configuration.
- [x] AC2: Two UDP tracker blocks with the same `0.0.0.0:0` binding each start with their own configuration.
- [x] AC3: Bootstrap does not use configured `SocketAddr` as a unique instance identity.
- [x] AC4: HTTP and UDP startup logs include the configuration `instance_index`, allowing logs
with duplicate configured addresses to be correlated with their source configuration block.
- [ ] AC5: Focused HTTP, UDP, and application bootstrap tests pass.
- [ ] AC6: `linter all` exits with code `0`.
- [x] AC5: Focused HTTP, UDP, and application bootstrap tests pass.
- [x] AC6: `linter all` exits with code `0`.

## Verification Plan

### Automatic Checks

- Focused regression tests for `AppContainer` and startup jobs after prerequisites land.
- `cargo test --test stats --test scaffold`.
- `tests/aggregate_stats_fixed_ports.rs`: enabled/enabled HTTP listeners on distinct fixed
ports must produce aggregate `tcp4_announces_handled == 2`. Enabled/disabled filtering
is deferred to #2039.
- Defer the equivalent UDP fixed-port and repeated-port-zero HTTP/UDP aggregate-statistics tests
to #2039; they assert listener-side metrics filtering rather than bootstrap configuration selection.
- `cargo test --test aggregate_stats_port_zero --test aggregate_stats_fixed_ports --test scaffold`.
- `linter all`.

### Manual Evidence Protocol

Before and after the bootstrap implementation, run the relevant scenarios
against a locally launched tracker and append exact configuration, commands,
final listener addresses, REST statistics, and observed result to
[evidence.md](evidence.md). Do not replace existing baseline evidence.

### Manual Verification Scenarios

| ID | Scenario | Expected Result | Status | Evidence |
| --- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------ | -------------------------- |
| M1 | Start two HTTP trackers with identical `0.0.0.0:0` bindings and different settings. | Each listener retains the settings from its own configuration block. | TODO | [evidence.md](evidence.md) |
| M2 | Repeat M1 for UDP trackers. | Each UDP listener retains the settings from its own configuration block. | TODO | |
| M3 | Run fixed-port enabled/enabled HTTP listeners locally. | The aggregate HTTP announce count is `2`. | DONE | |

## References

Expand Down
Loading
Loading