wujiuye opened a new issue #2005:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2005


   ## Bug Report
   
   If the current task fails to execute, even if the next execution is 
successful, the event tracking will get the exception information of the 
previous execution failure. The exception will only be overwritten and will not 
be deleted.
   
   ### Which version of ElasticJob did you use?
   
   Release Version: 3.0.0
   
   Master branch not repaired.
   
   ### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
   
   ElasticJob-Lite
   
   ### Reason analyze 
   
   Cause: the exception information of the last execution was not cleared.
   
   org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor#execute
   ```java
   private void execute(JobConfiguration jobConfig, ShardingContexts 
shardingContexts, ExecutionSource executionSource) {
           if (shardingContexts.getShardingItemParameters().isEmpty()) {
               
this.jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), 
State.TASK_FINISHED, String.format("Sharding item for job '%s' is empty.", 
jobConfig.getJobName()));
           } else {
               this.jobFacade.registerJobBegin(shardingContexts);
               String taskId = shardingContexts.getTaskId();
               this.jobFacade.postJobStatusTraceEvent(taskId, 
State.TASK_RUNNING, "");
   
               try {
                   this.process(jobConfig, shardingContexts, executionSource);
               } finally {
                   this.jobFacade.registerJobCompleted(shardingContexts);
                   if (this.itemErrorMessages.isEmpty()) {
                       this.jobFacade.postJobStatusTraceEvent(taskId, 
State.TASK_FINISHED, "");
                   } else {
                       this.jobFacade.postJobStatusTraceEvent(taskId, 
State.TASK_ERROR, this.itemErrorMessages.toString());
                   }
                   //  It is recommended to clear itemerrormessages here
               }
   
           }
       }
   ```
   
   


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