fix(QueueDepthChecker): respect queue.connections.<name>.connection - #70
Open
django23 wants to merge 2 commits into
Open
fix(QueueDepthChecker): respect queue.connections.<name>.connection#70django23 wants to merge 2 commits into
django23 wants to merge 2 commits into
Conversation
`getDatabaseQueueDepth()` used `DB::table()`, which queries the app's default DB connection. When the queue uses the `database` driver against a non-default connection (e.g. a dedicated SQLite file via DB_QUEUE_DATABASE, or a separate MySQL host), the check hits the wrong database and throws "no such table: jobs", flooding logs whenever the dashboard or its polling endpoint is open. Resolve the queue-specific connection (falling back to `database.default`) and route all four queries through `DB::connection($dbConnection)->table(...)`.
Two regression tests that fail against the pre-fix code with "no such table: jobs", and pass after the fix: 1. Queue uses `database` driver with a `connection` set to a separate in-memory SQLite, and `jobs` only exists there. Asserts depths come back correctly for both queues. 2. Same setup, filtered by a specific queue name.
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.
Problem
QueueDepthChecker::getDatabaseQueueDepth()usesDB::table(), which queries the app's default DB connection.When the
databasequeue driver is configured against a non-default connection; e.g. a dedicated SQLite file viaDB_QUEUE_DATABASE, or a separate MySQL host; the depth check hits the wrong database and throwsSQLSTATE[HY000]: General error: 1 no such table: jobs, flooding logs whenever the dashboard or its polling endpoint is open.Fix
Resolve the queue-specific connection (falling back to
database.default) and route all four queries throughDB::connection(\$dbConnection)->table(...).Same pattern already used in Laravel's own
DatabaseQueuedriver.Repro
config/queue.php:Open the Vantage dashboard → logs flood every poll cycle. After this PR: clean.