Github user shroman commented on a diff in the pull request:
https://github.com/apache/incubator-rocketmq/pull/20#discussion_r94050231
--- Diff: store/src/main/java/org/apache/rocketmq/store/CommitLog.java ---
@@ -964,9 +964,11 @@ public void run() {
boolean result = false;
for (int i = 0; i < RETRY_TIMES_OVER && !result; i++) {
--- End diff --
right, that's what I also thought and ask above about `RETRY_TIMES_OVER`.
Thank you for clarifying this.
How about this (flushing until data is available and `MAX_FLUSH_NUM` (which
can be quite large) is reached, and log warnings when cannot flush)?
```java
for (int i = 0; i < MAX_FLUSH_NUM && remainHowManyDataToFlush() > 0; i++) {
if (!CommitLog.this.mappedFileQueue.flush(0))
CommitLog.log.warn(this.getServiceName() + " service shutdown,
failed flush retried "
+ (i + 1) + " times");
}
CommitLog.log.info(this.getServiceName() + " service shutdown, all data is
flushed successfully");
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---