Repository navigation
Log a startup hint for per-attempt execution reconnects - #131
Merged
Merged
Conversation
PhiLily
force-pushed
the
worker-connection-hint
branch
from
October 10, 2026 15:27
f739391 to
dedd4f1
Compare
Log worker_connection_hint once at INFO during Worker.run() startup on PostgreSQL without pooling and on MySQL when CONN_MAX_AGE is zero. Include worker_id, database and vendor. Read settings without opening a connection or preventing startup. Keep default connection lifecycle, transactions, delivery and schema semantics unchanged. Persistence and pooling remain opt-in. Retained execution sessions carry state between tasks. Test the hint through the real ox_worker --batch command. Measure connection counts and idle-session disconnect recovery. Verify that workers with and without persistence share a queue using the same django-ox release.
PhiLily
force-pushed
the
worker-connection-hint
branch
from
October 10, 2026 17:09
dedd4f1 to
a111602
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.
What and why:
Log one
worker_connection_hintINFO record when the worker usesCONN_MAX_AGE = 0on PostgreSQL without pooling or on MySQL. Includeworker_id,databaseandvendoron thedjango_oxlogger.The hint reads settings without opening a connection. It is silent on SQLite, with retained connections, or with PostgreSQL pooling. It never prevents startup.
Configuration and compatibility
The execution connection serves task ORM work and outcome writing. Persistence remains opt-in through existing Django settings. Use worker-specific settings when web processes should retain their current configuration. Retained sessions require tasks to restore session state they change.
Default connection lifecycle, transactions, delivery and schema semantics are unchanged. This change adds a diagnostic, not faster defaults.
Validation
Tests exercise the real batch command, connection counts, idle-session disconnect recovery and persistent and default workers sharing a queue. Count tests pin existing behavior; the hint itself opens no connection.
Tests: ran on SQLite, PostgreSQL, pooled PostgreSQL and MySQL; new behaviour is covered by
tests/test_connection_count.py, which runs the realox_worker --batchcommand and counts driver connections.Changelog: entry added under Unreleased.