Skip to content

fix: add TrackingPayloadExt trait for ergonomic future tracking - #19296

Merged
drmingdrmer merged 4 commits into
databendlabs:mainfrom
drmingdrmer:367-fix-tracking
Jan 20, 2026
Merged

fix: add TrackingPayloadExt trait for ergonomic future tracking#19296
drmingdrmer merged 4 commits into
databendlabs:mainfrom
drmingdrmer:367-fix-tracking

Conversation

@drmingdrmer

@drmingdrmer drmingdrmer commented Jan 19, 2026

Copy link
Copy Markdown
Member

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

Summary

fix: add TrackingPayloadExt trait for ergonomic future tracking

Add an extension trait that provides a more fluent API for tracking futures
with payload. This replaces the verbose static method pattern with a method
call directly on the payload.

Changes:

  • Add TrackingPayloadExt trait with tracking() method for TrackingPayload, Arc<TrackingPayload>, and Option variants
  • Update all call sites to use payload.tracking(future) instead of ThreadTracker::tracking_future_with_payload(future, payload)
  • Remove redundant ThreadTracker::tracking(payload) guard patterns where the payload is immediately used with tracking()
  • Simplify InFlightRequest in grpc_service by removing thread guard field

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

Related Issues


This change is Reviewable

@github-actions github-actions Bot added the pr-bugfix this PR patches a bug in codebase label Jan 19, 2026
@drmingdrmer
drmingdrmer requested a review from zhang2014 January 19, 2026 17:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 317807497e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/common/base/src/runtime/perf/query_perf.rs Outdated
Add an extension trait that provides a more fluent API for tracking futures
with payload. This replaces the verbose static method pattern with a method
call directly on the payload.

Changes:
- Add `TrackingPayloadExt` trait with `tracking()` method for `TrackingPayload`, `Arc<TrackingPayload>`, and `Option` variants
- Update all call sites to use `payload.tracking(future)` instead of `ThreadTracker::tracking_future_with_payload(future, payload)`
- Remove redundant `ThreadTracker::tracking(payload)` guard patterns where the payload is immediately used with `tracking()`
- Simplify `InFlightRequest` in grpc_service by removing thread guard field
Comment thread src/common/base/src/runtime/perf/query_perf.rs
/// do_work().await
/// }).await;
/// ```
pub trait TrackingPayloadExt {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can remove the traits? The code has become more complex

Comment thread src/common/base/src/runtime/runtime_tracker.rs Outdated
Comment thread src/query/service/src/history_tables/alter_table.rs
@drmingdrmer
drmingdrmer merged commit fde50e6 into databendlabs:main Jan 20, 2026
168 of 171 checks passed
@drmingdrmer
drmingdrmer deleted the 367-fix-tracking branch January 20, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants