Failure Modes
:::info Source
Sourced from services/enrollment-service/FAILURE_MODES.md in the documentation repo.
:::
1. Scenarios
1.1 Duplicate license.granted Event
- Idempotent on
(tenantId, userId, courseId, source.ref).
1.2 Course Version Withdrawn Between Grant and Enrollment
- Validation at creation: fail with
enrollment.course_version.withdrawn; triggers marketplace saga compensation.
1.3 License Revoked During Active Session
- Revoke enrollment; content-service unmounts bundle; learner sees friendly error.
1.4 Expiration Job Stuck
- Nightly scheduler; alert if no runs in 24h.
1.5 Bulk Create Partial Failure
- Async with per-row result; continue-on-error mode for admins.
1.6 GDPR Erase Race (user playing)
- Grace: end current session; mark enrollment for deletion at session end.
2. Retry / Backoff
| Op | Max | Backoff |
|---|---|---|
| Postgres | 3 | 10ms–200ms |
| Outbox | infinite | exp cap 5m |
3. Circuit Breakers
None external critical.
4. Fallbacks
| Primary | Fallback |
|---|---|
| Real-time create | Queue (worker picks up) |
5. Chaos
- Duplicate events → single state.
- Kill worker → resume on restart.