Skip to content

[Chore][Improvement][Worker] Centralize varPool sync after physical task execution#18071

Open
Mrhs121 wants to merge 2 commits intoapache:devfrom
Mrhs121:fix-all-varpool
Open

[Chore][Improvement][Worker] Centralize varPool sync after physical task execution#18071
Mrhs121 wants to merge 2 commits intoapache:devfrom
Mrhs121:fix-all-varpool

Conversation

@Mrhs121
Copy link
Copy Markdown
Contributor

@Mrhs121 Mrhs121 commented Mar 16, 2026

Was this PR generated or assisted by AI?

Purpose of the pull request

We have already fixed similar varPool missing issues(such as: #17456, #18044, #17968, #18042) several times in different task implementations. Continuing to add setVarPool(...) case by case in each task makes it easy to miss again later.

After physicalTask.handle(...) completes, sync the task parameter varPool back to TaskExecutionContext in one place. This avoids repeating setVarPool(...) in each task implementation and prevents similar missing-varPool issues from being reintroduced in new plugins.

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

taskExecutorEventBus.publish(TaskExecutorRuntimeContextChangedLifecycleEvent.of(taskExecutor));
}
});
this.getTaskExecutionContext().setVarPool(this.physicalTask.getParameters().getVarPool());
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 would prefer to add this kind of lifecycle method at AbstractTask(maybe names ITaskPlugin in the future).
I plan to refactor some of the TaskPlugin interfaces in version 3.5.0.

@sonarqubecloud
Copy link
Copy Markdown

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants