Skip to content

Commit 4076193

Browse files
committed
Align stream cancellation regression with SDK result contract
1 parent c10c48e commit 4076193

3 files changed

Lines changed: 47 additions & 5 deletions

File tree

‎docs/implementation/status.json‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"decision": "docs/ADR/ADR-057-orleans-atomic-wal.md",
2626
"source": "generated_Orleans10.3.1_binary_mutations_closed_native_ReadOnlyMemoryOfByteCodec_explicit_kind_full_consumption_frame3_identity4_native_ZoneTree_unchanged",
2727
"upgrade": "offline_old_binary_compact_verified_backup_homogeneous_RF3_no_JSON_fallback",
28-
"verification": "native_storage_Release_build_and_scoped_final_formatter_pass_dirty_combined_solution_blocked_by59_unrelated_comparison_diagnostics_final_exact_source_GitHub_unit_process_RF3_comparison_qualification_pending_prior6ad_failures_preserved",
28+
"verification": "c10_Release_build_full_formatter_governance_analyzers118_normal1088_scalar1088_recovery136_RF3_63_pass_zero_skips_comparison3_of4_failed_exact_SDK_cancel_contract_locally_corrected_scoped_format_and_independent_review_pass_final_GitHub_full_gate_pending",
2929
"performance": "encoded_size_regression_authored_no_acceleration_power_loss_or_endurance_claim",
3030
"successorSequenceRepair": "source_guard_rejects_terminal_MaxValue_successor_before_decode_apply_or_truncation_real_checkpoint_legal_limit_wrapped_negative_unchanged_authority_and_ownership_regressions_GitHub_pending",
3131
"sourceReviewGaps": [
@@ -39,6 +39,39 @@
3939
"runId": 37077856823,
4040
"url": "https://github.com/managedcode/KeyLoad/actions/runs/37077856823",
4141
"conclusion": "failure"
42+
},
43+
"secondRun": {
44+
"sourceRevision": "c10c48e40d8a9b452c9d131da549cab1e336692d",
45+
"runId": 37079707413,
46+
"url": "https://github.com/managedcode/KeyLoad/actions/runs/37079707413",
47+
"conclusion": "failure",
48+
"normalUnit": {
49+
"passed": 1088,
50+
"total": 1088,
51+
"skipped": 0
52+
},
53+
"scalarUnit": {
54+
"passed": 1088,
55+
"total": 1088,
56+
"skipped": 0
57+
},
58+
"processRecovery": {
59+
"passed": 136,
60+
"total": 136,
61+
"skipped": 0
62+
},
63+
"rf3": {
64+
"passed": 63,
65+
"total": 63,
66+
"skipped": 0
67+
},
68+
"comparison": {
69+
"passed": 3,
70+
"total": 4,
71+
"skipped": 0,
72+
"failure": "KeyLoadStreamPublicRegression expected exception instead of exact SDK Cancelled result"
73+
},
74+
"measuredProfiles": "skipped_after_comparison_failure"
4275
}
4376
},
4477
"evidence": [

‎tests/KeyLoad.ComparisonTests/Features/BenchmarkComparisons/KeyLoadStreamPublicRegression.cs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ internal static class KeyLoadStreamPublicRegression
1414
private const ulong ExpectedRevision = 1;
1515
private const string ConflictingJson = "{\"payload\":\"conflict\"}";
1616
private const string ConflictCode = "KeyLoad:RevisionConflict";
17+
private const string CancelledCode = "KeyLoad:Cancelled";
1718

1819
internal static async Task VerifyAsync(DistributedApplication app, string adminKey,
1920
CancellationToken cancellationToken)
@@ -97,8 +98,8 @@ private static async Task VerifyCancellationAsync(IComparisonSession session, Be
9798
using var cancelled = new CancellationTokenSource();
9899
await cancelled.CancelAsync();
99100
var cancellationFailure = await CaptureCancellationAsync(() => session.ReadEventAsync(
100-
dataset.Documents[SeededDocumentIndex], cancelled.Token));
101-
await Assert.That(cancellationFailure is OperationCanceledException).IsTrue();
101+
dataset.Documents[SeededDocumentIndex], cancelled.Token), cancelled.Token);
102+
await Assert.That(cancellationFailure?.Message).IsEqualTo(CancelledCode);
102103
var following = dataset.CreateDocument(dataset.Options.Documents + FollowingStreamOffset);
103104
await session.ExecuteAsync(Scenario.StreamAppend, following, cancellationToken);
104105
await AssertEventAsync(await session.ReadEventAsync(following, cancellationToken), following);
@@ -127,14 +128,16 @@ private static async Task AssertEventAsync(FoundEvent? actual, BenchmarkDocument
127128
}
128129
}
129130

130-
private static async Task<OperationCanceledException?> CaptureCancellationAsync(Func<Task> operation)
131+
private static async Task<ComparisonFailureException?> CaptureCancellationAsync(
132+
Func<Task> operation, CancellationToken cancellationToken)
131133
{
132134
try
133135
{
134136
await operation();
135137
return null;
136138
}
137-
catch (OperationCanceledException exception)
139+
catch (ComparisonFailureException exception) when (
140+
cancellationToken.IsCancellationRequested && exception.Message == CancelledCode)
138141
{
139142
return exception;
140143
}

‎zonetree-orleans-wal.plan.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,9 @@ ADR057 now accepts explicit closed IFieldCodec<ReadOnlyMemory<byte>> registratio
8989
| TASK-WAL-NATIVE-FORMAT | WAL004/005; root high capability | Magic/identity/recovery guard and durable docs only; workers do not touch shared source | Fail closed for frames1/2, promote supported1/2/3 checkpoint-only; scoped source review/build/format then complete exact-final-SHA GitHub gate |
9090

9191
The independently reviewed native EnsureAvailable checks bound array count by remaining input bytes and byte-memory lengths before allocation. Serialized MaxFrameBytes is enforced; decoded-memory amplification for deliberately malformed recomputed-checksum frames remains an explicit unqualified capability/evidence gap. Native session reset is correct. This join does not invent a cap, duplicate wire decoding, claim maximum speed, or establish power-loss/endurance.
92+
93+
## Exact SDK cancellation contract join
94+
95+
Exact c10c48e40 run37079707413 builds/formats successfully; comparison3/4 reaches the next retained regression and fails on KeyLoad:Cancelled in KeyLoadStreamPublicRegression.CaptureCancellationAsync. KeyLoadClient.Send intentionally converts cancelled reads into Result/ErrorCode.Cancelled; KeyLoadClientResults.Success wraps that as ComparisonFailureException. The existing SDK regression already asserts this result contract. TASK-WAL-CI-METADATA preserving scope now includes the exact pre-cancelled read assertion: require the actual KeyLoad:Cancelled adapter code and an actually cancelled caller token; successful completion and all other exceptions/codes still fail. Keep following append/read, original seeded read and exact event identity/revision/payload assertions intact. This is a test-contract correction, no SDK/adapter/product API, topology, retry or deadline change; ADR N/A. Lead owns only the constant/assertion/helper hunk and the final complete GitHub source join; concurrent nodeCount/peer edits remain unstaged.
96+
97+
Completed c10c48e40 source gate: full solution build/formatter/governance and118 analyzer cases pass;1088/1088 normal and1088/1088 scalar units,136/136 real process recovery and63/63 RF3 SDK/MCP pass with0 skips. Comparison3/4 fails only the cancellation contract above; both measurement profiles skip after that failure. This is a failed whole workflow, not complete qualification. The exact preserving cancellation hunks pass independent source review and scoped formatting; dirty comparison build has9 unrelated isolated-feature diagnostics and0 owned cancellation diagnostics. Final revised-source full GitHub gate remains mandatory.

0 commit comments

Comments
 (0)