Skip to content

branch-4.0: [bugfix](k8s) fix log output for K8S environment in cloud and add unit tests #60490#60678

Merged
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60490-branch-4.0
Feb 13, 2026
Merged

branch-4.0: [bugfix](k8s) fix log output for K8S environment in cloud and add unit tests #60490#60678
yiguolei merged 1 commit intobranch-4.0from
auto-pick-60490-branch-4.0

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #60490

…t tests (#60490)

K8S uses stdout to capture logs. When service crashes, it tries to
output crash stack to .out file. Previously, it could not output to .out
file correctly. This patch standardizes the log output behavior for both
BE and Cloud components:

1. --daemon mode: output logs to .info file and crash stack to .out file
2. --console mode: 2.1 enable_file_logger = true: output all logs to
console (stdout) and to .info file, crash stack to .out file 2.2
enable_file_logger = false: output all logs to console (stdout) and
crash stack to .out file

Changes:
- Implement StdoutLogSink for custom log format output to stdout in K8S
- Modify console mode redirection in start scripts to separate
stdout/stderr
- Add shutdown_logging() function to properly clean up LogSink resources
- Add shutdown_logging() calls in main() functions for graceful shutdown
- Add comprehensive unit tests for both Cloud and BE components

This ensures crash stack is always saved to .out file for debugging,
while normal logs can be captured by K8S logging infrastructure.
@github-actions github-actions bot requested a review from yiguolei as a code owner February 11, 2026 08:57
@Thearas
Copy link
Contributor

Thearas commented Feb 11, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Feb 11, 2026
@Thearas
Copy link
Contributor

Thearas commented Feb 11, 2026

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 2.94% (1/34) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.10% (1783/2254)
Line Coverage 64.71% (31726/49026)
Region Coverage 65.35% (15833/24227)
Branch Coverage 55.90% (8409/15042)

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.03% (19119/36054)
Line Coverage 36.18% (177979/491876)
Region Coverage 32.79% (137961/420717)
Branch Coverage 33.70% (59790/177414)

@yiguolei yiguolei merged commit 85a1ea9 into branch-4.0 Feb 13, 2026
26 of 29 checks passed
@github-actions github-actions bot deleted the auto-pick-60490-branch-4.0 branch February 13, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants