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

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


The following commit(s) were added to refs/heads/master by this push:
     new 06c3cabde7 Fix bkperf log directory not found (#3858)
06c3cabde7 is described below

commit 06c3cabde7e311666837598c2b8ebd1a8aa00efc
Author: Hang Chen <[email protected]>
AuthorDate: Mon Mar 13 09:16:57 2023 +0800

    Fix bkperf log directory not found (#3858)
    
    ### Motivation
    When using the bkperf command `bin/bkperf journal append -j data -n 
100000000 --sync true` to test the BookKeeper journal performance, it failed 
with the following exception
    ```
    [0.002s][error][logging] Error opening log file 
'/Users/hangc/Downloads/tmp/tc/batch/ta/bookkeeper-all-4.16.0-SNAPSHOT/logs/bkperf-gc.log':
 No such file or directory
    [0.002s][error][logging] Initialization of output 
'file=/Users/hangc/Downloads/tmp/tc/batch/ta/bookkeeper-all-4.16.0-SNAPSHOT/logs/bkperf-gc.log'
 using options 'filecount=5,filesize=64m' failed.
    Invalid -Xlog option 
'-Xlog:gc=info:file=/Users/hangc/Downloads/tmp/tc/batch/ta/bookkeeper-all-4.16.0-SNAPSHOT/logs/bkperf-gc.log::filecount=5,filesize=64m',
 see error log for details.
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    ```
    
    The root cause is that the `logs` directory was not created.
    
    ### Modifications
    Create the `logs` directory before bkperf started.
---
 bin/bkperf | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/bkperf b/bin/bkperf
index 1cd3f71fce..02f8b20da2 100755
--- a/bin/bkperf
+++ b/bin/bkperf
@@ -50,6 +50,8 @@ CLI_LOG_FILE=${CLI_LOG_FILE:-"bkperf.log"}
 CLI_ROOT_LOG_LEVEL=${CLI_ROOT_LOG_LEVEL:-"INFO"}
 CLI_ROOT_LOG_APPENDER=${CLI_ROOT_LOG_APPENDER:-"CONSOLE"}
 
+mkdir -p ${CLI_LOG_DIR}
+
 # Configure the classpath
 CLI_CLASSPATH="$CLI_JAR:$CLI_CLASSPATH:$CLI_EXTRA_CLASSPATH"
 CLI_CLASSPATH="`dirname $CLI_LOG_CONF`:$CLI_CLASSPATH"

Reply via email to