Reflect running tasks in system.background_schedule_pool{,_log}#92587
Merged
azat merged 3 commits intoClickHouse:masterfrom Dec 24, 2025
Merged
Reflect running tasks in system.background_schedule_pool{,_log}#92587azat merged 3 commits intoClickHouse:masterfrom
azat merged 3 commits intoClickHouse:masterfrom
Conversation
There was a request for documention
Since I've added documentaiton I was filling a shame that the executing/elapsed_ms are useless columns. This patch does not looks great, but it will improve introspection
Contributor
|
Workflow [PR], commit [5a2eb04] Summary: ❌
|
Michicosun
approved these changes
Dec 24, 2025
| UInt64 task_type = getFunctionID(task_info.function); | ||
| auto & group = task_groups[task_type]; | ||
| group.tasks.emplace_back(task_info.shared_from_this()); | ||
| auto task_ptr = task_info.shared_from_this(); |
Member
There was a problem hiding this comment.
Interesting that num_running, I suppose, should be decremented here as well
Member
Author
There was a problem hiding this comment.
AFAICS we inc/dec it only in BackgroundSchedulePool::threadFunction, so when we really execute callback, so I think it is OK
But the behavior of running_tasks is slightly different, we erase the task from this container inside BackgroundSchedulePool::threadFunction only if !scheduled and if it is scheduled here, the reason we do so is to preserve the task at least in one container to make it always available for introspection if it was rescheduled inside the callback.
Merged
via the queue into
ClickHouse:master
with commit Dec 24, 2025
5327bfe
127 of 131 checks passed
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Reflect running tasks in system.background_schedule_pool{,_log}. Add documentation.
Follow-up for: #91157