sandynz commented on code in PR #28677:
URL: https://github.com/apache/shardingsphere/pull/28677#discussion_r1349650326


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/AbstractPipelineJob.java:
##########
@@ -90,24 +90,17 @@ protected void prepare(final PipelineJobItemContext 
jobItemContext) {
         try {
             doPrepare(jobItemContext);
             // CHECKSTYLE:OFF
-        } catch (final RuntimeException ex) {
-            // CHECKSTYLE:ON
-            processFailed(jobItemContext, ex);
-            throw ex;
-            // CHECKSTYLE:OFF
         } catch (final SQLException ex) {
             // CHECKSTYLE:ON
-            processFailed(jobItemContext, ex);
             throw new PipelineInternalException(ex);
         }
     }
     
     protected abstract void doPrepare(PipelineJobItemContext jobItemContext) 
throws SQLException;
     
-    protected void processFailed(final PipelineJobItemContext jobItemContext, 
final Exception ex) {
-        String jobId = jobItemContext.getJobId();
-        log.error("job prepare failed, {}-{}", jobId, 
jobItemContext.getShardingItem(), ex);
-        jobAPI.updateJobItemErrorMessage(jobItemContext.getJobId(), 
jobItemContext.getShardingItem(), ex);
+    protected void processFailed(final String jobId, final int shardingItem, 
final Exception ex) {
+        log.error("job prepare failed, {}-{}", jobId, shardingItem, ex);
+        jobAPI.updateJobItemErrorMessage(jobId, shardingItem, ex);
         jobAPI.stop(jobId);
     }

Review Comment:
   Could we move `processFailed` to `AbstractSimplePipelineJob`?



-- 
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]

Reply via email to