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 34c3543
Browse filesBrowse the repository at this point in the historyBrowse files
Each connection has one serialized protocol-state owner; request handlers may run concurrently on configured workers. State-changing operations from handlers return to the connection owner. Shared route tables, IP policy, hooks, and TLS snapshots publish immutable generations so readers need no global hot-path lock. This is a target responsibility split, not a direct transplant of v2's MHD callback services.
53
53
54
+
Peer policy implements this split with an atomic `shared_ptr<const generation>` owning both pattern vectors, enabled state, mode and derived armed state. A writer mutex serializes read-modify-publish operations against the latest generation, preventing lost independent updates. Parsing happens before serialization. Each reader retains one owned generation through both scans; no reader-held shared mutex spans the scan. Atomic shared-pointer operations are not promised to be lock-free. The scalar `armed()` acquire load remains the unused-policy gate. Writers release-publish the generation before release-storing that gate; after passing the gate, classification acquire-loads a generation and checks its own armed state, including disabled acceptance. Overlapping calls may use an older complete generation; operations synchronized after a completed mutation observe the published update.
55
+
56
+
Candidate construction leaves the previous generation intact on failure. Pattern mutators retain their existing throwing allocation behavior and typed invalid-pattern outcomes. The existing `noexcept` mode/enabled setters now allocate to copy a generation: allocation failure terminates, rather than silently dropping an update. These setters already offered no recoverable failure channel for synchronization failures. Generation lifetime is bounded by the current publication and in-flight readers; the policy introduces no reclamation queue or custom hazard-pointer scheme. TASK-188's bounded progress, independent-writer and installed listener evidence pins this publication contract.
57
+
54
58
### 3.1 Public semantic interface (illustrative, not final signatures)
Copy file name to clipboardExpand all lines: specs/tasks/M14-v3-release-repairs/TASK-188.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,10 @@
9
9
**Workflow:** Follow `../v3-release-repair-workflow.md`; resolve TASK-188 with the worktree helper, require `base_branch=v3`, root-cause investigation and verified RED/GREEN before changes, then Groundwork validation/finalization.
10
10
11
11
**Action Items:**
12
-
-[] Reproduce the frozen `peer_policy/concurrent_mutation_and_reads` stall. Inspect test joining/termination and `src/detail/peer_policy.cpp` shared-mutex paths; collect bounded writer-progress observations before concluding starvation, deadlock or test lifecycle error.
13
-
-[] Add a bounded concurrency regression which holds reader pressure until a writer completes, asserts consistent classifications and fails on missing mutation progress. Terminate/join every thread on failure; do not solve this by weakening the number of mutations/readers, adding sleeps, raising the release deadline or making the readers stop before writers need progress.
14
-
-[] Apply the proven repair. Prefer architecture's immutable generation publication with serialized writers if shared-mutex starvation is established; preserve atomic stance/list consistency, deny/allow precedence, typed invalid patterns, armed fast path and live mutation from handlers. Clear concurrency doubts with tests before committing.
15
-
-[] Check concurrent add/remove/mode/enabled publication and real public listener live policy changes; retain parser/truth-table compatibility and update architecture if the implementation publication model changes.
12
+
-[x] Reproduce the frozen `peer_policy/concurrent_mutation_and_reads` stall. Inspect test joining/termination and `src/detail/peer_policy.cpp` shared-mutex paths; collect bounded writer-progress observations before concluding starvation, deadlock or test lifecycle error.
13
+
-[x] Add a bounded concurrency regression which holds reader pressure until a writer completes, asserts consistent classifications and fails on missing mutation progress. Terminate/join every thread on failure; do not solve this by weakening the number of mutations/readers, adding sleeps, raising the release deadline or making the readers stop before writers need progress.
14
+
-[x] Apply the proven repair. Prefer architecture's immutable generation publication with serialized writers if shared-mutex starvation is established; preserve atomic stance/list consistency, deny/allow precedence, typed invalid patterns, armed fast path and live mutation from handlers. Clear concurrency doubts with tests before committing.
15
+
-[x] Check concurrent add/remove/mode/enabled publication and real public listener live policy changes; retain parser/truth-table compatibility and update architecture if the implementation publication model changes.
16
16
17
17
**Acceptance Criteria:**
18
18
- Existing `peer_policy` finishes within the unchanged 180-second release deadline under normal TLS-off/on; the bounded writer-progress regression passes under normal, ASan/UBSan and TSan.
**Implementation evidence:**[TASK-188 implementation evidence](../../architecture/v3/TASK-188-implementation-evidence.md). Six local C++20 normal/ASan/UBSan/TSan TLS-off/on lanes and installed managed/external live-policy consumers pass; Groundwork validation passed in one iteration with eight approvals, zero fixes and zero unworked findings (run `476f15d40115b153d901c612b1b6473d`). All implementation build/debug receipts are retained beneath `build/task188-evidence/implementation-2cc58b4b/` in the primary worktree, with a SHA256 archive manifest.
0 commit comments