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

Add a bin/jobs binstub to run the supervisor more easily and remove the async mode #308

Merged
merged 10 commits into from
Sep 2, 2024

Conversation

rosa
Copy link
Member

@rosa rosa commented Aug 28, 2024

This also fixes that the supervisor couldn't be started in async mode unless using the Puma plugin This completely removes the async mode, as we've decided to make this straightforward and simpler and offer just a single way to run it.

This PR also includes other minor issues in the installation: avoiding overwriting an existing config/solid_queue.yml file and accepting a --database parameter to specify a separate Solid Queue DB to install the migrations. The new bin/jobs binstub is copied over as part of the installation.

@rosa rosa changed the title Add a bin/jobs binstub to run the supervisor more easily Add a bin/jobs binstub to run the supervisor more easily and remove the async mode Aug 29, 2024
rosa added 8 commits August 31, 2024 13:15
…on install

We never want to skip the migrations but we might want to skip setting
the adapter if we're moving from another Active Job backend. Also, add a
`database` option to select a different DB from the main one when
copying the migrations.
Still running all its supervised processes as threads, but now can be
run separately from Puma.
And rename sidecar to standalone, inverting the meaning.
And a nicer Cli class to use over in the binstub with better args
instead of environment variables.
As reported in #305. I haven't managed to reproduce this, but the right
logic is definitely the one in this commit. Thanks to @Darhazer for
catching this.
It's been short-lived ^_^U
@rosa rosa merged commit 940c6ac into main Sep 2, 2024
8 checks passed
@rosa rosa deleted the binstub branch September 2, 2024 11:20
@floehopper
Copy link

Is the new bin/jobs bin stub equivalent to bundle exec rake solid_queue:start? Is either one preferred over the other?

@rosa
Copy link
Member Author

rosa commented Sep 5, 2024

Great question! It's mostly equivalent, witih a few differences. It allows passing a --config_file option with a different location for the workers and dispatchers configuration (with the Rake task you need to set an environment variable, SOLID_QUEUE_CONFIG, if you wanted to change that). It also behaves a bit differently with respect to eager loading, I believe, because Rake tasks ignore config.eager_load = true, there's an additional setting config.rake_eager_load to get this enabled, but I think many people might not have it enabled: rails/rails#28209 (comment)

I'd say bin/jobs is preferred, to be consistent with other Rails commands/tasks that have their own binstub like this.

@floehopper
Copy link

@rosa Thanks for explaining!

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