andsel commented on a change in pull request #2854:
URL: https://github.com/apache/rocketmq/pull/2854#discussion_r662960164
##########
File path: store/src/main/java/org/apache/rocketmq/store/CommitLog.java
##########
@@ -623,27 +646,22 @@ public long getBeginTimeInLock() {
mappedFile = this.mappedFileQueue.getLastMappedFile(0);
if (null == mappedFile) {
// XXX: warn and notify me
- log.error("create mapped file2 error, topic: " +
msg.getTopic() + " clientAddr: " + msg.getBornHostString());
- beginTimeInLock = 0;
- return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, result));
+ log.error("create mapped file error, topic: " +
msg.getTopic() + " clientAddr: " + msg.getBornHostString());
+ throw new
Exceptions.CreateMappedfileFailedException(result);
}
result = mappedFile.appendMessage(msg,
this.appendMessageCallback);
break;
case MESSAGE_SIZE_EXCEEDED:
case PROPERTIES_SIZE_EXCEEDED:
- beginTimeInLock = 0;
- return CompletableFuture.completedFuture(new
PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, result));
+ throw new Exceptions.MessageIllegalException(result);
Review comment:
Hi, I moved from throwing exceptions to returning a couple with error or
result
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]