Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat(spider-tdl): Expose the executing execution manager's metadata in TaskContext. - #498

Open
20001020ycx wants to merge 1 commit into
y-scope:mainfrom
20001020ycx:feat/2026-09-23-taskcontext-em-rg
Open

20001020ycx wants to merge 1 commit into
y-scope:mainfrom
20001020ycx:feat/2026-09-23-taskcontext-em-rg

Conversation

@20001020ycx

@20001020ycx 20001020ycx commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR encapsulates the executing execution manager's metadata into the TaskContext handed to every task, so a task can identify the execution manager that ran it and the resource group that manager is pinned to.

pub struct TaskContext {
    pub job_id: JobId,
    pub task_id: TaskId,
    pub task_instance_id: TaskInstanceId,
    pub resource_group_id: ResourceGroupId,
    pub execution_manager_metadata: ExecutionManagerMetadata,
    // ...
}

/// Metadata of the execution manager driving the current task execution.
pub struct ExecutionManagerMetadata {
    pub id: ExecutionManagerId,
    pub pinned_resource_group_id: Option<ResourceGroupId>, // None = general execution manager
}
  • resource_group_id is unchanged — the resource group the task belongs to (from the scheduler's task assignment). It is the same regardless of which worker runs the task.
  • A new execution_manager_metadata carries metadata of the execution manager driving the task: its id, and pinned_resource_group_id — the resource group it is dedicated to, or None for a general execution manager.

#501 adds a resource-group isolation e2e that consumes this metadata — see it for a usage example.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation Performed

  • All CI checks pass.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c57560e8-c347-4d5a-8fda-e6ae5d6e173f

📥 Commits

Reviewing files that changed from the base of the PR and between b78d00e and e8fd07c.

📒 Files selected for processing (10)
  • components/spider-execution-manager/src/process_pool.rs
  • components/spider-execution-manager/src/runtime.rs
  • components/spider-tdl/src/lib.rs
  • components/spider-tdl/src/task.rs
  • components/spider-tdl/src/task_context.rs
  • components/spider-tdl/tests/test_task_macro.rs
  • tests/huntsman/task-executor/tests/test_process_pool.rs
  • tests/huntsman/tdl-integration/tests/complex.rs
  • tests/huntsman/tdl-integration/tests/init.rs
  • tests/huntsman/test-utils/src/executor.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@20001020ycx
20001020ycx force-pushed the feat/2026-09-23-taskcontext-em-rg branch from 4358310 to f4ef5d6 Compare September 24, 2026 14:07
@20001020ycx 20001020ycx changed the title feat(spider-tdl)!: Expose the executing execution manager's resource group in TaskContext. feat(spider-tdl): Expose the executing execution manager's metadata in TaskContext; add a resource-group isolation e2e for dedicated worker pools. Sep 24, 2026
@20001020ycx
20001020ycx force-pushed the feat/2026-09-23-taskcontext-em-rg branch 7 times, most recently from d8984f5 to 79f667a Compare September 24, 2026 15:33

@LinZhihao-723 LinZhihao-723 left a comment

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.

Before we proceed further, can we break this PR into two:

  • The first PR only updates TaskContext.
  • The second PR will update the actual test cases.

@20001020ycx

Copy link
Copy Markdown
Contributor Author

Before we proceed further, can we break this PR into two:

  • The first PR only updates TaskContext.
  • The second PR will update the actual test cases.

Okay, on it!

@20001020ycx
20001020ycx force-pushed the feat/2026-09-23-taskcontext-em-rg branch from 79f667a to e8fd07c Compare September 24, 2026 20:53
@20001020ycx 20001020ycx changed the title feat(spider-tdl): Expose the executing execution manager's metadata in TaskContext; add a resource-group isolation e2e for dedicated worker pools. feat(spider-tdl): Expose the executing execution manager's metadata in TaskContext. Sep 24, 2026
@20001020ycx
20001020ycx marked this pull request as ready for review September 24, 2026 20:58
@20001020ycx
20001020ycx requested review from a team and sitaowang1998 as code owners September 24, 2026 20:58
pub id: ExecutionManagerId,

/// The resource group ID the execution manager pins to, if any.
pub pinned_resource_group_id: Option<ResourceGroupId>,

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.

I don't think we need pinned_ prefix. As a member of this metadata, it should be clear that this resoruce_group_id is the resource group ID of the execution manager.

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.

2 participants