rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vongosl...@apache.org
Subject [rocketmq] branch develop updated: [ISSUE #2334] Polish the log and response remark when service not available (#2335)
Date Mon, 12 Oct 2020 00:58:47 GMT
This is an automated email from the ASF dual-hosted git repository.

vongosling 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 c932941  [ISSUE #2334] Polish the log and response remark when service not available
(#2335)
c932941 is described below

commit c932941f30803257579b118571a735a3d464a8a0
Author: rongtong <jinrongtong5@163.com>
AuthorDate: Mon Oct 12 08:58:21 2020 +0800

    [ISSUE #2334] Polish the log and response remark when service not available (#2335)
    
    * enhancement(response & log):polish the log and response remark when service not
available
    
    * enhancement(response remark & log): make log and response remark better understand
    
    * chore(style): modify code style to pass CI tests
---
 .../broker/processor/ReplyMessageProcessor.java         | 17 +++++++++--------
 .../rocketmq/broker/processor/SendMessageProcessor.java |  3 ++-
 .../org/apache/rocketmq/store/DefaultMessageStore.java  |  5 +++--
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/ReplyMessageProcessor.java
b/broker/src/main/java/org/apache/rocketmq/broker/processor/ReplyMessageProcessor.java
index 565857a..2890fc4 100644
--- a/broker/src/main/java/org/apache/rocketmq/broker/processor/ReplyMessageProcessor.java
+++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/ReplyMessageProcessor.java
@@ -251,28 +251,29 @@ public class ReplyMessageProcessor extends AbstractSendMessageProcessor
implemen
 
             // Failed
             case CREATE_MAPEDFILE_FAILED:
-                log.info("create mapped file failed, server is busy or broken.");
+                log.warn("create mapped file failed, server is busy or broken.");
                 break;
             case MESSAGE_ILLEGAL:
-                log.info(
+                log.warn(
                     "the message is illegal, maybe msg properties length limit 32k.");
                 break;
             case PROPERTIES_SIZE_EXCEEDED:
-                log.info(
+                log.warn(
                     "the message is illegal, maybe msg body or properties length not matched.
msg body length limit 128k.");
                 break;
             case SERVICE_NOT_AVAILABLE:
-                log.info(
-                    "service not available now, maybe disk full, maybe your broker machine
memory too small.");
+                log.warn(
+                    "service not available now. It may be caused by one of the following
reasons: " +
+                        "the broker's disk is full, messages are put to the slave, message
store has been shut down, etc.");
                 break;
             case OS_PAGECACHE_BUSY:
-                log.info("[PC_SYNCHRONIZED]broker busy, start flow control for a while");
+                log.warn("[PC_SYNCHRONIZED]broker busy, start flow control for a while");
                 break;
             case UNKNOWN_ERROR:
-                log.info("UNKNOWN_ERROR");
+                log.warn("UNKNOWN_ERROR");
                 break;
             default:
-                log.info("UNKNOWN_ERROR DEFAULT");
+                log.warn("UNKNOWN_ERROR DEFAULT");
                 break;
         }
 
diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
b/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
index 20b5cfa..d8f53e4 100644
--- a/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
+++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
@@ -480,7 +480,8 @@ public class SendMessageProcessor extends AbstractSendMessageProcessor
implement
             case SERVICE_NOT_AVAILABLE:
                 response.setCode(ResponseCode.SERVICE_NOT_AVAILABLE);
                 response.setRemark(
-                    "service not available now, maybe disk full, " + diskUtil() + ", maybe
your broker machine memory too small.");
+                    "service not available now. It may be caused by one of the following
reasons: " +
+                        "the broker's disk is full [" + diskUtil() + "], messages are put
to the slave, message store has been shut down, etc.");
                 break;
             case OS_PAGECACHE_BUSY:
                 response.setCode(ResponseCode.SYSTEM_ERROR);
diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
index 5462e76..89e2cc0 100644
--- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
+++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
@@ -392,7 +392,7 @@ public class DefaultMessageStore implements MessageStore {
         if (BrokerRole.SLAVE == this.messageStoreConfig.getBrokerRole()) {
             long value = this.printTimes.getAndIncrement();
             if ((value % 50000) == 0) {
-                log.warn("message store has shutdown, so putMessage is forbidden");
+                log.warn("broke role is slave, so putMessage is forbidden");
             }
             return PutMessageStatus.SERVICE_NOT_AVAILABLE;
         }
@@ -400,7 +400,8 @@ public class DefaultMessageStore implements MessageStore {
         if (!this.runningFlags.isWriteable()) {
             long value = this.printTimes.getAndIncrement();
             if ((value % 50000) == 0) {
-                log.warn("message store has shutdown, so putMessage is forbidden");
+                log.warn("the message store is not writable. It may be caused by one of the
following reasons: " +
+                    "the broker's disk is full, write to logic queue error, write to index
file error, etc");
             }
             return PutMessageStatus.SERVICE_NOT_AVAILABLE;
         } else {


Mime
View raw message