Skip to content

Conversation

@BohuTANG
Copy link
Member

@BohuTANG BohuTANG commented Sep 4, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Replace generic "[QUERY-QUEUE] Waiting for resource scheduling" messages with specific, actionable logs that show:

  • Configuration parameters: max_concurrency=5, max_running_queries=8
  • Current usage: 5/5 slots used, 3 queries waiting
  • Clear status: [BLOCKED] vs [ACQUIRED] with wait times

Before:

[QUERY-QUEUE] Waiting for resource scheduling

After:

[BLOCKED] Workload group 'analytics' local limit (max_concurrency=5): 5/5 slots used
[BLOCKED] Warehouse limit (max_running_queries=8): 8/8 slots used, 3 queries waiting

Users can now immediately identify bottlenecks and adjust the right configuration parameters.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Manual testing verified log output format and accuracy

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Sep 4, 2025
…ation details

- Show specific configuration parameters (max_concurrency, max_running_queries)
- Display current resource usage (X/Y slots used)
- Include queue length and wait times for better visibility
- Distinguish between workload group and warehouse limits with clear [BLOCKED]/[ACQUIRED] status
@BohuTANG BohuTANG force-pushed the improve-queue-scheduling-logs branch from c69f550 to 6194d0a Compare September 4, 2025 12:32
- Replace subtraction with saturating_sub to avoid potential underflow
- Simplify variable naming for better readability
- Ensure thread-safe calculation of used slots
@BohuTANG BohuTANG added the ci-cloud Build docker image for cloud test label Sep 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Docker Image for PR

  • tag: pr-18684-1d4a242-1756993059

note: this image tag is only available for internal use.

- Replace remaining generic status messages with specific blocked status
- Update workload group global semaphore acquisition message
- Ensure all code paths show detailed configuration information
- Add test to verify status messages during workload group concurrency limits
- Simulate 100 concurrent queries with max_concurrency=16
- Capture and log status messages for debugging queue behavior
@BohuTANG BohuTANG added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Sep 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Docker Image for PR

  • tag: pr-18684-eb9c243-1757002700

note: this image tag is only available for internal use.

@BohuTANG
Copy link
Member Author

BohuTANG commented Sep 5, 2025

image

- Add queue length to workload group local limit messages
- Add queue length to workload group global limit messages
- Ensure consistency with warehouse limit messages that already show waiting count
- Replace [BLOCKED] with [WAITING] prefix for all queue status messages
- More user-friendly indication that queries are waiting rather than blocked
@BohuTANG BohuTANG added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Sep 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

Docker Image for PR

  • tag: pr-18684-667929d-1757036527

note: this image tag is only available for internal use.

@BohuTANG BohuTANG merged commit e333923 into main Sep 5, 2025
107 of 108 checks passed
@BohuTANG BohuTANG deleted the improve-queue-scheduling-logs branch September 5, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cloud Build docker image for cloud test pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants