[DSIP-23][TaskPlugin] Add Lifecycle method to TaskPlugin
Search before asking
- [X] I had searched in the issues and found no similar feature requirement.
Description
Right now, we have define some methods at the Task plugin, e.g. init, handle, cancel.
There are no close methods, so it's not convenient if we need to close some resource after the task plugin executes.
So it's needed to add Lifecycle interface to do this.
Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hello, I have a question. Resource close will occur during task execution, so there shouldn't be any need to pay attention to it in the lifecycle of task plugins, such as sqltask. @ruanwenjun
Hello, I have a question. Resource close will occur during task execution, so there shouldn't be any need to pay attention to it in the lifecycle of task plugins, such as sqltask. @ruanwenjun
We should close the resource in the task lifecycle method rather than in the task plugin, this can help to avoid resource leak problem.
Hello, I have a question. Resource close will occur during task execution, so there shouldn't be any need to pay attention to it in the lifecycle of task plugins, such as sqltask. @ruanwenjun
We should close the resource in the task lifecycle method rather than in the task plugin, this can help to avoid resource leak problem.
@ruanwenjun Yes, different tasks use resources differently, so it should be reasonable to close them after using resources in the handle method, right?
@niumy0701 Yes, the resource leak has occured in many task plugins.
Hello, I have a question. Resource close will occur during task execution, so there shouldn't be any need to pay attention to it in the lifecycle of task plugins, such as sqltask. @ruanwenjun
We should close the resource in the task lifecycle method rather than in the task plugin, this can help to avoid resource leak problem.
@ruanwenjun ok, Can we first add a close method to AbstractTask, and then implement the close method for the task plugin that needs to close the resource
Hello, I have a question. Resource close will occur during task execution, so there shouldn't be any need to pay attention to it in the lifecycle of task plugins, such as sqltask. @ruanwenjun
We should close the resource in the task lifecycle method rather than in the task plugin, this can help to avoid resource leak problem.
@ruanwenjun ok, Can we first add a close method to AbstractTask, and then implement the close method for the task plugin that needs to close the resource
Considering plugin upgrade compatibility, make modifications based on the plugins that require resource closure. dms: Depends on #17723 emr: Depends on #17724 sagemaker: Depends on #17725
