Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Scheduler failed to run any jobs after Redis flush #5

Merged
merged 1 commit into from Oct 15, 2020

Conversation

gschlager
Copy link
Member

This adds a check that runs every 60 seconds. It schedules all available jobs for a queue if the keys of the per host queue and the global queue are missing from Redis.

expect(queued_jobs(manager, with_hostname: false)).to include(Testing::SuperLongJob)
expect(queued_jobs(manager, with_hostname: true)).to include(Testing::PerHostJob)

redis.flushdb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flushdb kind of makes me nervous, is there any way you can be more surgical here? Maybe if all our keys are prefixed just delete keys with that prefix? do we flushdb much in our specs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we flush a couple of times in Discourse core. Anyway, I pushed a new version which deletes only keys with the _scheduler_ prefix.

@SamSaffron
Copy link
Member

Nice change and I support the naming change as well!

This adds a check that runs every 60 seconds. It schedules all available jobs for a queue if the keys of the per host queue and the global queue are missing from Redis.
@SamSaffron
Copy link
Member

Looks good to me... merge away

@gschlager gschlager merged commit e358bf6 into master Oct 15, 2020
@gschlager gschlager deleted the fix/recover-from-redis-flush branch October 15, 2020 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants