Skip to content

branch-4.0: [fix](be) Add missing SCOPED_ATTACH_TASK in download and move_dir callbacks #62403#62541

Open
github-actions[bot] wants to merge 1 commit intobranch-4.0from
auto-pick-62403-branch-4.0
Open

branch-4.0: [fix](be) Add missing SCOPED_ATTACH_TASK in download and move_dir callbacks #62403#62541
github-actions[bot] wants to merge 1 commit intobranch-4.0from
auto-pick-62403-branch-4.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #62403

…lbacks (#62403)

### What problem does this PR solve?
Problem Summary:
download_callback() and move_dir_callback() in task_worker_pool.cpp use
  SnapshotLoader/CloudSnapshotLoader to perform HDFS downloads and file
  moves, but do not attach the MemTracker to the thread context via
SCOPED_ATTACH_TASK. This causes memory orphan check failures when these
  callbacks allocate memory through HDFS operations, as the allocations
  are not tracked by any MemTrackerLimiter.

The parallel upload_callback() already has SCOPED_ATTACH_TASK correctly.

### Release note
Fix: Add SCOPED_ATTACH_TASK(loader->resource_ctx()) in all four missing
  locations:
  - download_callback(StorageEngine&): remote_http_download branch
  - download_callback(StorageEngine&): broker download branch
  - download_callback(CloudStorageEngine&): cloud download branch
  - move_dir_callback(StorageEngine&): local move branch
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Apr 16, 2026
@hello-stephen
Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 0.00% (0/4) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.98% (19258/36352)
Line Coverage 36.15% (179476/496426)
Region Coverage 32.78% (139357/425114)
Branch Coverage 33.70% (60391/179223)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 0.00% (0/4) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.30% (25373/35586)
Line Coverage 54.02% (267686/495540)
Region Coverage 51.51% (221170/429390)
Branch Coverage 53.01% (95340/179854)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants