Repository navigation
fix: config traversal, timer rethrow, stack-trace reset, lock scope (MAPCO-11323) - #258
shimoncohen wants to merge 3 commits into
Conversation
|
For the record re: the earlier note on string key = string.Join(":", configPath);
return this.config.GetSection(key).GetChildren();
|
…MAPCO-11323) Four independent correctness fixes in MergerLogic. - ConfigurationManager.GetChildren: the traversal loop read from the root config each iteration instead of the accumulated section, and its bounds re-applied the last key. Correct for 2-part paths (the only current caller) but wrong for 1- and 3+-part paths. Walk the accumulated section instead. - HeartbeatClient.Send (Timer.Elapsed handler): rethrew on failure. The Timer discards it and an unhandled exception on the timer thread can tear down the process. Log and let the next tick retry. - S3Client: `throw e;` reset the exception stack trace on the non-key error paths; use `throw;` to preserve it. - Gpkg/Fs/S3: the batch _locker was static, so every instance serialized its paging against every other instance. Make it per-instance — the state it guards is per-instance — which also unblocks parallelism for SVC-1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collapse the manual section-traversal loop to a single colon-joined GetSection call, matching GetConfiguration's style. IConfiguration treats ":" as the hierarchy separator, so this nests through all segments and is equivalent for the sole caller (length-2 "TASK:types") while also handling paths of any length. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7ea1c55 to
20b7f13
Compare
CL-SHLOMIKONCHA
left a comment
There was a problem hiding this comment.
Approved, but I would reword this comment: System.Timers.Timer already swallows exceptions from Elapsed handlers, so the throw; was a no-op, not a crash risk.
HeartbeatClient.cs line 88
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@CL-SHLOMIKONCHA Heartbeat comment reworded in 73635c1: the Elapsed rethrow was a no-op since System.Timers.Timer swallows it; the catch now logs instead. |
LOGIC-4 of MAPCO-11317. Four independent correctness fixes.
Fixes
ConfigurationManager.GetChildrenwalked from the root section on every loop iteration (not the accumulated section) and its bounds re-applied the final key. Works for 2-part paths — which is the only current caller,GetChildren("TASK","types")— but silently wrong for 1-part and 3+-part paths. Now traverses the accumulated section.HeartbeatClient.Sendis aTimer.Elapsedhandler that rethrew on failure.System.Timers.Timerdiscards it, and an unhandled exception on the timer thread can tear down the process. Now logs and lets the next tick retry.S3Clientusedthrow e;on its non-key error paths, resetting the exception's stack trace. Changed tothrow;.Gpkg/Fs/S3held their batch_lockerasstatic, so every data-source instance serialized paging against every other instance. The guarded state is per-instance, so the lock is now per-instance. Also unblocks parallelism for SVC-1 (MAPCO-11325).Testing
Full suite: 1141 passed, 0 failed. Fixes 1 and 4 preserve current behavior for existing call sites (2-part config path; single-instance paging) while correcting the latent/ cross-instance cases; 2 and 3 change only failure-path behavior.
ConfigurationManagerbuilds itsIConfigurationfrom files in its ctor and isn't injectable, soGetChildrenhas no isolated unit test; the fix is exercised via theTaskRunnerpath.🤖 Generated with Claude Code