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 into
branch-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 into
branch-4.0from
auto-pick-60490-branch-4.0

Conversation

@github-actions

Copy link
Copy Markdown
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.
@Thearas

Copy link
Copy Markdown
Contributor

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?

@Thearas

Copy link
Copy Markdown
Contributor

run buildall

@doris-robot

Copy link
Copy Markdown

Cloud UT Coverage Report

Increment line coverage 2.94% (1/34) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage79.10% (1783/2254)
Line Coverage64.71% (31726/49026)
Region Coverage65.35% (15833/24227)
Branch Coverage55.90% (8409/15042)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage53.03% (19119/36054)
Line Coverage36.18% (177979/491876)
Region Coverage32.79% (137961/420717)
Branch Coverage33.70% (59790/177414)

@yiguolei
yiguolei merged commit 85a1ea9 into branch-4.0Feb 13, 2026
26 of 29 checks passed
@github-actions
github-actionsBot deleted the auto-pick-60490-branch-4.0 branch February 13, 2026 01:58
ybtsdst pushed a commit to ybtsdst/doris that referenced this pull request Feb 27, 2026
… and add unit tests apache#60490 (apache#60678)
Cherry-picked from apache#60490
Co-authored-by: deardeng <dengxin@selectdb.com>
Sign up for freeto 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

@Thearas@doris-robot@hello-stephen@yiguolei@dataroaring@deardeng