Repository navigation
Improve Library - #4
Merged
Merged
Conversation
runtime); fixed doc/code mismatches around RunAndWait* and cleanup - Recover dead sessions periodically (was one-shot) and cover Pending chunks by persisting session ids at batch start - Reconcile stalled batch counters so WaitForCompletion cannot hang - Claim/recover chunks under UpdLock; make Cleanup safe mid-batch - Use server-default session timeout instead of undocumented explicit 0 - Preserve multi-line errors in GetErrors; validate record ranges, thread count, and reserved $ payload keys; fix cleanup hour overflow - BREAKING: WaitForCompletion now errors inside a write transaction - Add 17 tests covering each fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
README (critical)
JsonArrayis 0-based, but bothexamples iterated
1..Count. Rewritten withforeach.RunAndWait*keeps batch records by default,partial-failure results are returned, documented
AutoCleanup/Errorsoverloads, null-GUID return for empty input, missing
Commit()in the retryexample, new Known Constraints (stable record sets, reserved
$keys).Liveness — batch can no longer get stuck in
Runninglate are still recovered.
StartBatchpersists each chunk's session id, so recovery also coversPendingchunks whose session died before reachingRunning.WaitForCompletionreconciles stalled counters when every chunk isterminal but the batch row still says
Running(dispatcher died between itstwo final commits).
Robustness
UpdLockand only ifPending— removes writeraces with the coordinator and recovery.
UpdLockbefore failing it — no morepotential concurrency error in the caller.
Cleanupduring a live batch is now safe (guarded re-reads everywhere).StartSessionoverload without thetimeout parameter (explicit
0was undocumented platform behavior).GetErrorspreserves multi-line error text (was truncated to first line).GetRecordReffails loudly when the record set changed since batch creation.CleanupOlderThanno longer overflows for large hour values; set-based delete.SetThreads(<1)errors;$-prefixed payload keys rejected;SetResult/AppendResultrequire an initialized context.WaitForCompletionnow errors if called inside a write transaction (itsrecovery paths commit internally — previously this could silently commit caller
changes).
Tests
17 new tests: stalled-counter reconciliation, dead Running/Pending chunk
recovery, write-transaction guard, config/payload validation, multi-line errors,
record-range validation, cleanup overflow, session-id persistence, and
mid-batch cleanup safety. Both apps compile clean with all analyzers.