This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 1754cece4b Restore the lost PR 3460 (#10067)
1754cece4b is described below
commit 1754cece4bfce186aabec21fd40cfff00cc1dabd
Author: gaoyf <[email protected]>
AuthorDate: Fri Feb 6 15:30:15 2026 +0800
Restore the lost PR 3460 (#10067)
---
store/src/main/java/org/apache/rocketmq/store/CommitLog.java | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
index 078d484c6f..a1c18874fd 100644
--- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
+++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
@@ -1095,7 +1095,6 @@ public class CommitLog implements Swappable {
}
if (null == mappedFile) {
log.error("create mapped file1 error, topic: {}
clientAddr: {}", msg.getTopic(), msg.getBornHostString());
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.CREATE_MAPPED_FILE_FAILED, null));
}
@@ -1112,7 +1111,6 @@ public class CommitLog implements Swappable {
if (null == mappedFile) {
// XXX: warn and notify me
log.error("create mapped file2 error, topic: {}
clientAddr: {}", msg.getTopic(), msg.getBornHostString());
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.CREATE_MAPPED_FILE_FAILED, result));
}
if (isCloseReadAhead()) {
@@ -1125,17 +1123,15 @@ public class CommitLog implements Swappable {
break;
case MESSAGE_SIZE_EXCEEDED:
case PROPERTIES_SIZE_EXCEEDED:
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, result));
case UNKNOWN_ERROR:
default:
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));
}
elapsedTimeInLock =
this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;
- beginTimeInLock = 0;
} finally {
+ beginTimeInLock = 0;
putMessageLock.unlock();
}
// Increase queue offset when messages are successfully written
@@ -1260,7 +1256,6 @@ public class CommitLog implements Swappable {
}
if (null == mappedFile) {
log.error("Create mapped file1 error, topic: {}
clientAddr: {}", messageExtBatch.getTopic(),
messageExtBatch.getBornHostString());
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.CREATE_MAPPED_FILE_FAILED, null));
}
@@ -1275,7 +1270,6 @@ public class CommitLog implements Swappable {
if (null == mappedFile) {
// XXX: warn and notify me
log.error("Create mapped file2 error, topic: {}
clientAddr: {}", messageExtBatch.getTopic(),
messageExtBatch.getBornHostString());
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.CREATE_MAPPED_FILE_FAILED, result));
}
if (isCloseReadAhead()) {
@@ -1285,17 +1279,15 @@ public class CommitLog implements Swappable {
break;
case MESSAGE_SIZE_EXCEEDED:
case PROPERTIES_SIZE_EXCEEDED:
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, result));
case UNKNOWN_ERROR:
default:
- beginTimeInLock = 0;
return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));
}
elapsedTimeInLock =
this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;
- beginTimeInLock = 0;
} finally {
+ beginTimeInLock = 0;
putMessageLock.unlock();
}