fix(miner): reclaim orphaned worktree allocations on every acquire() - #8918
Conversation
reclaimOrphanedAllocations previously only ran once inside openWorktreeAllocator(), so a long-lived fleet worker never re-swept a peer's crashed/orphaned allocation after open -- only a process restart re-triggered reclaim. acquire() now calls it at the start of every invocation, matching portfolio-queue-manager.ts's claimNextBatch per-claim sweep pattern. Reworked the allocator's nowMs handling into a getNowMs() closure so production callers get a genuinely fresh Date.now() on every reclaim (open-time and every acquire()), while a test's injected nowMs stays frozen across both -- preserving the existing age-based reclaim suite's determinism. Refs JSONbored#8859.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8918 +/- ##
==========================================
- Coverage 93.84% 90.61% -3.24%
==========================================
Files 803 97 -706
Lines 80084 22610 -57474
Branches 24277 3917 -20360
==========================================
- Hits 75157 20487 -54670
+ Misses 3562 1945 -1617
+ Partials 1365 178 -1187
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 13:31:13 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Fixes #8859.
Test plan