mxsm opened a new issue, #4734:
URL: https://github.com/apache/rocketmq/issues/4734

   
![image](https://user-images.githubusercontent.com/15797831/181907798-7bda812a-68f3-4930-b120-081258ffb377.png)
   
![image](https://user-images.githubusercontent.com/15797831/181907805-09af1599-5035-4b4f-abeb-08a9e57de604.png)
   DLedgerController.startScheduling implementation has concurrency problems
   simulation test,for example:
   ```java
   public class Test {
   
       private volatile boolean isScheduling = false;
   
       public static final CyclicBarrier barrier = new CyclicBarrier(200);
   
       public static void main(String[] args) throws Exception{
   
           Test aaa = new Test ();
   
           ExecutorService executorService = Executors.newFixedThreadPool(200);
           for(int i = 0; i < 200; ++i){
               executorService.submit(new Runnable() {
                   @Override
                   public void run() {
                       aaa.startScheduling();
                   }
               });
           }
   
       }
   
   
       public void startScheduling() {
           try {
               barrier.await();
           } catch (InterruptedException e) {
               e.printStackTrace();
           } catch (BrokenBarrierException e) {
               e.printStackTrace();
           }
           if (!this.isScheduling) {
               System.out.println(Thread.currentThread().getName());
               this.isScheduling = true;
           }
       }
   }
   ```
   console print log:
   
![image](https://user-images.githubusercontent.com/15797831/181907976-b246a3ec-ced7-4708-b8fe-c82d6d7b0582.png)
   more than one thread execute if code snippet


-- 
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: dev-unsubscr...@rocketmq.apache.org.apache.org

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

Reply via email to