[ROCKETMQ-33] CPU Occupy 100%#31
Conversation
|
Sorry,I wrote the wrong issue number,it shoud be [ROCKETMQ-33] CPU Occupy 100% |
| while (!this.isStopped()) { | ||
| try { | ||
| this.waitForRunning(0); | ||
| this.waitForRunning(1000); |
There was a problem hiding this comment.
GroupCommitService will be used when broker is in SYNC_FLUSH, so the flushCommitLogService need always doCommit without a break.
And this won't cause 100% CPU usage unless your server only has one cpu core.
BTW, how about use ASYNC_FLUSH if you mind.
There was a problem hiding this comment.
I also think waitForRunning(0) is too rigorous, but waitForRunning(1000) is adventurous while the GroupCommitService may miss some notify signals.
How about set a smaller wait time, like 10ms? what's your opinion ? @qinliujie
|
When I use ASYNC_MASTER,there was the same problem,Because HAService also has When you said that the |
|
Thanks @qinliujie, please @vongosling @stevenschew help review. |
|
review ok. |
|
Hi, @qinliujie This PR will be merged soon, but next time please send PR from branch ROCKETMQ-33 instead of master. |
|
@zhouxinyu OK. |
|
waitForRunning(0) is call wait(0). wait(0) is wait forever util somenoe notify the Thread |
|
I agreee with @Ah39 , 0ms is wait forever, which should not cause high cpu problem, any other justice reason to modify it to 10ms? |
|
old version use the Object wait() method,but it had changed to countdown latch in new version,please notice that @Jaskey |
…ice/HAService, closes apache#31
https://issues.apache.org/jira/browse/ROCKETMQ-33