matanper opened a new issue, #71059: URL: https://github.com/apache/doris/issues/71059
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version master (`bin/start_be.sh`, `be/src/common/logconfig.cpp`); the same code is in branch-4.1. `bin/start_fe.sh` has the same shape for `fe.out`. ### What's Wrong? `be.out` is never rotated or capped, and when its volume fills up the BE can no longer start. - `bin/start_be.sh:685-689`: with `--console` (how the Kubernetes images start the BE), `doris_be`'s stderr is appended to `log/be.out` (`2>>"${LOG_DIR}/be.out"`). The non-console paths (`:681-691`) append both stdout and stderr to it. - `be/src/common/logconfig.cpp:157-171`: in console mode glog goes to the stdout sink and `FLAGS_stderrthreshold` is `FATAL`, so glog itself does not write to `be.out`. Everything else that writes to stderr does: third-party libraries, the embedded JVM, crash output and anything else using `std::cerr`/`fprintf(stderr, ...)`. - Nothing rotates, truncates or caps `be.out`. glog's own files rotate (`sys_log_roll_num`, `sys_log_roll_mode`); `be.out` does not, so it grows for the life of the volume. - `bin/start_be.sh:111-119`: the start script's `log()` appends to `be.out` before `doris_be` is exec'd, and the script runs under `set -eo pipefail` (`:19`). Once the log volume is full, that append fails with `echo: write error: No space left on device`, the script exits, and the BE never starts. On Kubernetes that becomes a CrashLoopBackOff that only clears when someone frees space on the volume by hand. We hit this on query BEs: `be.out` reached ~30 GB on each of them and filled their 50 GiB log volumes, and a routine restart then left one in CrashLoopBackOff. Most of that was written in bursts; we have not yet identified the component that wrote it, but whatever the writer is, an unbounded file in the log directory turns any stderr spam into a BE that cannot restart. ### What You Expected? `be.out` has a size bound, like the glog files beside it. For example: - rotate or truncate `be.out` at a configurable size (keep the tail), from `start_be.sh` or a small watcher, or - in console mode, send stderr to the console too (as stdout already is), so the container runtime's own log rotation applies and nothing accumulates in the log volume, keeping `be.out` only for the start-up lines, or - at minimum, have `start_be.sh` not fail to start the BE when it cannot append its start-up lines to `be.out`. The same applies to `fe.out` in `bin/start_fe.sh`. ### How to Reproduce? 1. Start a BE with `start_be.sh --console` (or the BE Kubernetes image) on a small log volume. 2. Write to the BE's stderr until the volume is full, e.g. a UDF or JNI call that prints to stderr, or simulate it with `fallocate -l <size> log/be.out`. 3. Restart the BE: `start_be.sh` fails with `echo: write error: No space left on device` and the BE does not start. ### Anything Else? We can open a PR. ### Are you willing to submit PR? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
