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 2021/10/11 03:44:51 UTC

[GitHub] [shardingsphere-elasticjob] Wjcccccccccc opened a new issue #1996: The threads of ReconcileService doesn't been recycled after shut downing the job by JobOperateAPI

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


   ## Bug Report
   Start 100 ScheduleJobBootstrap jobs, and shut down all of them immediately.
   Check the JVM Thread Dump, found that 100 Threads of ReconcileService appear.
   ```
   "ReconcileService" prio=0 tid=0x0 nid=0x0 waiting on condition
        java.lang.Thread.State: TIMED_WAITING
    on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@4662db48
   	at sun.misc.Unsafe.park(Native Method)
   	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
   	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
   	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
   	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
   	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   
   ```
   
   ### Which version of ElasticJob did you use?
   3.0.0
   
   ### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
   ElasticJob-Lite
   
   ### Steps to reproduce the behavior.
   There is the reproducible code.
   ```
   public class Main {
   
       public static void main(String[] args) throws InterruptedException {
           final ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration("192.168.10.110:2181", "test");
           final ZookeeperRegistryCenter zookeeperRegistryCenter = new ZookeeperRegistryCenter(zookeeperConfiguration);
           zookeeperRegistryCenter.init();
           final JobOperateAPIImpl jobOperateAPI = new JobOperateAPIImpl(zookeeperRegistryCenter);
   
           CountDownLatch cdl = new CountDownLatch(1);
   
           String cron = "*/5 * * * * ?";
           int jobNumber = 100;
   
           List<String> jobNames = new ArrayList<>(jobNumber);
   
           for (int i = 0; i < jobNumber; i++) {
               String jobName = "testJob-" + i;
               jobNames.add(jobName);
               final JobConfiguration jobConfiguration = JobConfiguration
                       .newBuilder(jobName, 1)
                       .overwrite(true)
                       .monitorExecution(true)
                       .failover(true)
                       .cron(cron)
                       .build();
               new ScheduleJobBootstrap(zookeeperRegistryCenter, new TestScheduledJob(), jobConfiguration).schedule();
           }
   
           Thread.sleep(3000L);
   
           jobNames.parallelStream().forEach(jobName -> {
   //            final String serverIp = JobRegistry.getInstance().getJobInstance(jobName).getServerIp();
               jobOperateAPI.shutdown(jobName, null);
           });
   
           cdl.await();
   
       }
   }
   
   ```
   


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