You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/07/30 11:03:36 UTC
[GitHub] [rocketmq] mxsm opened a new issue, #4734: DLedgerController.startScheduling implementation has concurrency problems
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-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] RongtongJin commented on issue #4734: DLedgerController.startScheduling implementation has concurrency problems
Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #4734:
URL: https://github.com/apache/rocketmq/issues/4734#issuecomment-1200140632
@mxsm Could you submit a pull request to fix the issue?
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] duhenglucky closed issue #4734: DLedgerController.startScheduling implementation has concurrency problems
Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #4734: DLedgerController.startScheduling implementation has concurrency problems
URL: https://github.com/apache/rocketmq/issues/4734
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] mxsm commented on issue #4734: DLedgerController.startScheduling implementation has concurrency problems
Posted by GitBox <gi...@apache.org>.
mxsm commented on issue #4734:
URL: https://github.com/apache/rocketmq/issues/4734#issuecomment-1200142661
> @mxsm Could you submit a pull request to fix the issue?
I will submit a PR to fix the issue
--
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-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org