Skip to content

Conversation

@flavorjones
Copy link
Member

Process#register and #degister for the supervisor to start up properly.

RecurringSchedule#reload_tasks resolves all the records immediately to avoid deferred resolution outside the executor block.

Supervisor#handle_claimed_jobs_by wraps its code in the executor.

A second attempt at #655 without causing the issues from #670

This PR unfortunately doesn't add any tests; I tried and failed to come up with a strategy that would check all database code was wrapped properly that didn't involve massive restructuring of tests. If you have any good ideas on how to do that, please let me know.

(As an aside, the reason for this PR and #655 is that I'm working on multi-tenant support for Solid Queue, using Active Record Tenanted which relies on Rails' sharding features. I'd like to use the app executor's run/complete callbacks to set/unset the shard.)

Process#register and #degister for the supervisor to start up
properly.

RecurringSchedule#reload_tasks resolves all the records immediately to
avoid deferred resolution outside the executor block.

Supervisor#handle_claimed_jobs_by wraps its code in the executor.

A second attempt at rails#655 without causing the issues from rails#670
@flavorjones
Copy link
Member Author

flavorjones commented Oct 29, 2025

Some of these tests are failing against Rails main because of the problem fixed in #674

The others seem to have been flaky docker behavior.

Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

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

Fantastic, this is great. Thanks a lot @flavorjones!

@rosa rosa merged commit 5c6d4b0 into rails:main Oct 29, 2025
41 of 52 checks passed
@flavorjones flavorjones deleted the flavorjones/supervisor-executor-2 branch October 30, 2025 09:13
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.

2 participants