Skip to main content

One-Shot Jobs Restart Unexpectedly

One-shot jobs like batch queries and data exports may restart after the edge process restarts—even when they have no retry policy and should fail permanently if interrupted.

Why This Happens

When the edge process restarts, it tries to resume all jobs that were running. One-shot jobs that should have "run once, no retry" behavior may incorrectly restart. This can cause duplicate side effects like repeated writes, API calls, or exports.

Workarounds

  1. Make batch operations idempotent — Use unique IDs, upsert operations, or check-before-execute logic so repeated runs don't create duplicates
  2. Monitor for duplicate executions — Track execution IDs and timestamps in your output system to detect when jobs run more than once
  3. Use external locking — Implement distributed locks to prevent duplicate execution across restarts