Skip to content

Use configured time for job snoozes and retries#1332

Draft
pablobaldez wants to merge 1 commit into
riverqueue:masterfrom
pablobaldez:pblbaldez-job-snooze-time-generator
Draft

Use configured time for job snoozes and retries#1332
pablobaldez wants to merge 1 commit into
riverqueue:masterfrom
pablobaldez:pblbaldez-job-snooze-time-generator

Conversation

@pablobaldez

Copy link
Copy Markdown

Config.Test.Time is used when River evaluates whether scheduled jobs
are eligible to run, but JobSnooze and the default retry policy derived
their next scheduled_at values from the process wall clock. When a
configured time generator differed from wall time, this mixed two
timelines in the same scheduling flow and could make snoozed or retried
jobs run too early or remain ineligible for much longer than intended.

Here, derive snooze timestamps from the executor's configured time and
initialize River's default retry policy from the same base service clock.
This also initializes the default fallback policy in producer and
rivertest.Worker execution paths. Custom retry policies are unchanged,
and zero-value use continues to fall back to wall time.

Regression coverage exercises both job snoozing and retrying through the
public client boundary with a configured time generator. Focused tests
and make lint pass. The full local make test run encounters existing
TestProducer_PollOnly timeouts that reproduce on the unchanged base
commit.

Fixes #1322.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JobSnooze ignores Config.Test.Time when calculating scheduled_at

1 participant