This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new a5099a2d3b [minor](log) print error msg to fe.out before log is 
initialized (#22106)
a5099a2d3b is described below

commit a5099a2d3b3bdfd4bb21361ffc1ed61b4195bbe8
Author: Mingyu Chen <morning...@163.com>
AuthorDate: Sun Jul 23 19:20:10 2023 +0800

    [minor](log) print error msg to fe.out before log is initialized (#22106)
    
    The exception may be thrown before LOG is initialized.
    Such as wrong config value. So we need to print it to fe.out, otherwise
    we can't know what's wrong.
    
    After this PR, the error can be found in fe.out, such as:
    
    ```
    java.lang.NumberFormatException: For input string: "3g"
            at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
            at java.lang.Long.parseLong(Long.java:589)
            at java.lang.Long.parseLong(Long.java:631)
            at 
org.apache.doris.common.ConfigBase.setConfigField(ConfigBase.java:253)
            at org.apache.doris.common.ConfigBase.setFields(ConfigBase.java:232)
            at org.apache.doris.common.ConfigBase.initConf(ConfigBase.java:146)
            at org.apache.doris.common.ConfigBase.init(ConfigBase.java:112)
            at org.apache.doris.DorisFE.start(DorisFE.java:101)
            at org.apache.doris.DorisFE.main(DorisFE.java:73)
    ```
---
 fe/fe-core/src/main/java/org/apache/doris/DorisFE.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java 
b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
index 7d87091120..07394d9cd4 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
@@ -187,6 +187,9 @@ public class DorisFE {
                 Thread.sleep(2000);
             }
         } catch (Throwable e) {
+            // Some exception may thrown before LOG is inited.
+            // So need to print to stdout
+            e.printStackTrace();
             LOG.warn("", e);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to