Skip to content

Commit ec0dbef

Browse files
authored
arg: Flush log before exiting after usage() (ggml-org#25504)
Under certain conditions, it's possible for messages emitted via LOG() to get lost before exit, apparently because they are emitted by another thread. common_params_print_usage() uses printf directly, and is not affected. Flushing the log before exit seems to resolve this.
1 parent c1063ac commit ec0dbef

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

common/arg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ bool common_params_parse(int argc, char ** argv, common_params & params, llama_e
10771077
if (ctx_arg.print_usage) {
10781078
ctx_arg.print_usage(argc, argv);
10791079
}
1080+
common_log_flush(common_log_main());
10801081
exit(0);
10811082
}
10821083
if (ctx_arg.params.completion) {

0 commit comments

Comments
 (0)