Repository navigation
Conversation
Eager loading lib/solid_queue/cli.rb loads Thor in every process of an application that eager loads, like its web servers, although only bin/jobs uses the CLI, and bin/jobs requires it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rosa
force-pushed
the
do-not-eager-load-cli
branch
from
November 2, 2026 19:01
81f4a56 to
b5d1484
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zeitwerk eager loads
lib/solid_queue/cli.rb, which requires Thor, so every process of an application that eager loads, like its Puma workers, loads Thor and the CLI. Onlybin/jobsuses the CLI, and the generatedbin/jobsrequiressolid_queue/cliitself.This leaves
cli.rbout of eager loading withdo_not_eager_load.SolidQueue::Cliis still autoloaded when referenced.Booting a new Rails application (
rails new, Rails main, Solid Queue 1.7.0) in production witheager_load, Ruby 3.4.12 on Debian 13, 7 alternating runs:The test boots the dummy app in a subprocess, eager loads, and checks
SolidQueue::Cliis still an autoload. It fails without the change.bin/rails testpasses with SQLite, with and withoutCI=1(which turns on eager loading in the dummy app's test environment).🤖 Generated with Claude Code