andsel commented on a change in pull request #2854:
URL: https://github.com/apache/rocketmq/pull/2854#discussion_r637376530



##########
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:
       It requires to create an extra object (the exception itself) and bring 
the stack trace of current thread, I've not any measure about performance loss. 
Do you think this is critical?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to