sandynz commented on code in PR #19895:
URL: https://github.com/apache/shardingsphere/pull/19895#discussion_r938652749
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/execute/PipelineJobExecutor.java:
##########
@@ -102,7 +104,11 @@ private void processEvent(final DataChangedEvent event,
final JobConfigurationPO
private void execute(final JobConfigurationPOJO jobConfigPOJO) {
RuleAlteredJob job = new RuleAlteredJob();
RuleAlteredJobCenter.addJob(jobConfigPOJO.getJobName(), job);
- new OneOffJobBootstrap(PipelineAPIFactory.getRegistryCenter(), job,
jobConfigPOJO.toJobConfiguration()).execute();
+ if (null != oneOffJobBootstrap) {
+ oneOffJobBootstrap.shutdown();
+ }
+ oneOffJobBootstrap = new
OneOffJobBootstrap(PipelineAPIFactory.getRegistryCenter(), job,
jobConfigPOJO.toJobConfiguration());
+ oneOffJobBootstrap.execute();
Review Comment:
Could we shutdown oneOffJobBootstrap when job is shutting down?
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/execute/PipelineJobExecutor.java:
##########
@@ -48,6 +48,8 @@ public final class PipelineJobExecutor extends
AbstractLifecycleExecutor {
private final ExecutorService executor = Executors.newFixedThreadPool(20);
+ private OneOffJobBootstrap oneOffJobBootstrap;
Review Comment:
It's better to put in `RuleAlteredJob`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]