Skip to content

Resilient Background Job Orchestration & Fault-Tolerance Framework #719

@SatyamPandey-07

Description

@SatyamPandey-07

Objective: Move away from simple node-cron schedules. Implement a stateful "Job Manager" that saves execution state to MongoDB, handles automatic retries with exponential backoff, and ensures that long-running tasks (like audits or backups) don't overlap or silent-crash.

Files involved (9):
models/JobState.js (New: Tracks every task execution and result)
services/jobOrchestrator.js (New: The core execution engine)
utils/retryStrategy.js (New: Logic for backoff and jitter)
middleware/jobGuard.js (New: Prevents unauthorized manual job triggers)
routes/jobs.js (New: Management API to retry/pause jobs)
jobs/logRotator.js
(Update: Refactor to new JobState pattern)
jobs/conflictCleaner.js
(Update: Refactor to new JobState pattern)
server.js
(Update: Global orchestrator mount)
tests/jobOrchestration.test.js (New: Reliability tests)

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions