All problems

Sync Worker Marks Rate-Limited Jobs Complete

Level 2 · node · Reliability · HTTP success status range error

Scenario

A worker synchronizes users with an external directory provider and persists the job state after each response. It considers any provider response below 500 successful, so a 429 rate-limit response marks the job completed. The job then leaves the retry queue and synchronization items are lost.

Requirements

- Treat only 2xx responses as successful synchronization - Keep 429 responses in retry state and store Retry-After - Keep 5xx responses in retry state - Store the provider syncedCount on successful responses - Record terminal 4xx responses as failed

Acceptance criteria

  • A 200 response becomes completed
  • A 429 response becomes retry
  • Retry-After from a 429 response is stored
  • A 503 response becomes retry
  • A 400 response becomes failed