Skip to content

Email queue orphaned job detection uses wall clock — vulnerable to clock drift #925

Description

@hman38705

Labels: reliability, email

Priority: Medium

Description

src/email/queue.rs uses SystemTime::now() to detect stale/orphaned jobs. If the system clock is adjusted (NTP step, daylight saving, clock skew between instances), jobs can be falsely detected as orphaned or miss the detection window entirely.

Acceptance Criteria

  • Replace SystemTime with a monotonic duration tracked from job creation (store job enqueue timestamp in the Redis value, compare against UTC now from the database or a trusted NTP source)
  • Add a configurable EMAIL_ORPHAN_THRESHOLD_SECS variable (default 300)
  • Add a test that simulates clock skew and verifies orphan detection is not affected

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programemailEmail service and queuereliabilityResilience, recovery, and uptime

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions