-
Notifications
You must be signed in to change notification settings - Fork 3.6k
AAP-60452 Remove the dynamic log level filter for the dispatcherd main process #16200
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
Open
AlanCoding
wants to merge
6
commits into
ansible:devel
Choose a base branch
from
AlanCoding:dispatcher_logging
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−2
Conversation
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
Member
Author
|
TODO: After the dispatcherd patch merges, we need to have a special case in the task for processing a settings change to run the new control command. |
08e849d to
1ba8665
Compare
Member
Author
|
Manual testing looking good, just need some actual tests now. |
Configure the dynamic logging level only on startup
846b15c to
4484b7c
Compare
|
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.
SUMMARY
Right now, it looks like logs will respect the dynamic_level_filter, and this is a bad thing, and was never intended. Because doing this means talking to postgres, and that has no async version, which means that it will likely create a new synchronous connection in asyncio code, which is very bad, although it might be kind of working for now.
This sets the dynamic log level only on startup, and then just to be sure, closes the connection.
I will put up a separate proposal for on-the-fly adjustments of the log level which I argue should be done by memory modification via a task (formally a control task), which the dispatcherd process, specifically, has facilities to allow.
ISSUE TYPE
COMPONENT NAME
Note
Configures
dispatcherdmain-process logging to bypass the dynamic level filter, set level fromLOG_AGGREGATOR_LEVELat startup, close sync resources before async startup, propagate log-level changes via control, add tests, and bumpdispatcherdversion.dynamic_level_filterfrom parent-process handlers and setdispatcherdlogger level fromsettings.LOG_AGGREGATOR_LEVELinrun_dispatcher.Command.configure_dispatcher_logging.dispatcherd, close Django DB connection and cache to avoid sync usage in async startup.clear_setting_cache, whenLOG_AGGREGATOR_LEVELchanges, sendset_log_levelcontrol todispatcherdonget_task_queuename().clear_setting_cachesendingset_log_leveland forconfigure_dispatcher_loggingupdating the logger level.dispatcherd[pg_notify]to2025.12.12.Written by Cursor Bugbot for commit 9d24c5c. This will update automatically on new commits. Configure here.