You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/02/28 15:29:33 UTC

[GitHub] [shardingsphere-elasticjob] Wzy19930507 edited a comment on issue #1549: when elastic job instance is suspended(can't communicate with leader,but not dead), even if "monitorExecution" is true, it cannot guarantee that the same sharding will only run on one instance at the same time

Wzy19930507 edited a comment on issue #1549:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1549#issuecomment-1054356804


   @terrymanu  elastic-job-lite 幂等失效场景复现
   
   1. 开发工具 idea,idea debug 经过断点时会暂停所有线程,导致zk无法发送心跳。
   2. 三个分片,开启幂等,idea启动三个实例:
   3. 其中一个实例打断点,位置如下:
   ```
   public class StudyMonitorExecutionJob implements SimpleJob {
   
     private int i = 0;
   
     @Override
     public void execute(ShardingContext shardingContext) {
         // 其中一个实例在 这里打断点
         log.info("StudySimpleJob ShardingItem: {}", shardingContext.getShardingItem());
         i++;
         try {
           Thread.sleep(20_000);
         } catch (InterruptedException e) {
           log.info("StudySimpleJob ShardingItem ------------------- down1");
         }
       }
     }
   }
   ```
   4. 经过一段时间后,打断点的实例掉线,其他实例重新分片
   5. 重新分片之后,打断点的实例继续执行任务,幂等失效。


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org