polardb / polardb/polardbx-sql

startup.sh -I error "initialize gms failed ..." not written to logfile

Open
#24 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.7k
Forks
337
PR merge metrics
No merged PRs in 30d

Description

运行 startup.sh -I 初始化GMS时,如果出现错误,没有生成日志文件tddl.log

polardbx-server/src/main/java/com/alibaba/polardbx/server/TddlLauncher.java
67 try {
68 initUserAccount(config);
69 initGms(config);
70 initPolarxRootUser(config);
71 System.err.println("Initialize polardbx success");
72 System.exit(0);
73 } catch (SQLException e) {
74 logger.error("initialize gms failed due to: " + e);
75 System.exit(1);
76 }
根据conf/logbak.xml中的配置,此logger会走到asyncROOT appender,由于程序立即退出,日志会来不及写入日志文件(tddl.log)
有两种改法都可以:1)简单的在exit之前增加 e.printStackTrace(); 2)在exit之前Thread.sleep(3000) (我自己的环境sleep 1秒就可以)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in polardbx-server/src/main/java/com/alibaba/polardbx/server/TddlLauncher.java at the initGms error handler and review the asyncROOT appender configuration in conf/logbak.xml. Verify the failure path around System.exit(1), then confirm that an initialization error is written to tddl.log or otherwise printed before the process exits.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.