feat: add distributed job scheduler with lease-based worker claiming (closes #76) - #122
Merged
JamesEjembi merged 2 commits intoJul 30, 2026
Conversation
…loses VeriNode-Labs#76) Add src/job_scheduler/mod.rs implementing a priority-queue job scheduler with exclusive lease-based worker claiming: - Workers acquire jobs by priority, holding time-bound leases - Lease renewal prevents expiry while a worker processes a job - Expired leases auto-release jobs back to the pending queue - Max acquisition attempts guard before dead-lettering - Comprehensive test suite (17 tests) covering: - Enqueue/acquire/complete lifecycle - Lease expiry and re-queuing - Worker ownership enforcement - Priority ordering - Capacity limits - Metrics export for monitoring dashboards
Both src/config_audit.rs and src/replication/mod.rs already existed but were never declarated as pub mod in lib.rs, causing unresolved import errors in tests/config_audit_test.rs and tests/replication_dr_test.rs.
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.
Summary
Adds
src/job_scheduler/mod.rs, a priority-queue distributed job scheduler with exclusive lease-based worker claiming.Changes
src/job_scheduler/mod.rs(725 lines)src/lib.rs— addedpub mod job_scheduler;Test Coverage (17 tests)
Design
alloc) for Soroban/WASM compatibilityCloses #76