linghengqian commented on issue #2490:
URL: 
https://github.com/apache/shardingsphere-elasticjob/issues/2490#issuecomment-4399018297

   
   From the current implementation, this does not seem to cause the misfired 
job to be executed twice.
   
   `JobTriggerListener#triggerMisfired(...)` only sets the misfire flag in 
ZooKeeper, while the actual re-execution is still controlled by 
`ElasticJobExecutor`. In `ElasticJobExecutor#execute()`, if the previous 
execution is still running, `misfireIfRunning(...)` returns `true` and the 
current trigger exits directly. After the running job completes, the executor 
checks the misfire flag and performs the misfire execution in the `while 
(isExecuteMisfired(...))` block.
   
   So the duplicated part is the misfire marking, not the actual job execution. 
Since the misfire node is created via `createJobNodeIfNeeded(...)`, this 
operation is effectively idempotent.


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