Skip to content

fix: avoid logger deadlock on broken error channel - #1964

Merged
Zephyrcf merged 1 commit into
dragonflyoss:masterfrom
tedcy:fix/nydusd-enospc-logger-hang
Jun 15, 2026
Merged

fix: avoid logger deadlock on broken error channel#1964
Zephyrcf merged 1 commit into
dragonflyoss:masterfrom
tedcy:fix/nydusd-enospc-logger-hang

Conversation

@tedcy

@tedcy tedcy commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Overview

This bumps flexi_logger to 0.28.0 and tells it not to panic when its own error output channel is broken.

That is the path hit in #1958. When cache/log/stdout/stderr are on a full filesystem, a secondary logger error can make nydusd stop answering the daemon API.

Related Issues

Fixes #1958

Change Details

  • Bump flexi_logger from 0.25.6 to 0.28.0.
  • Call .panic_if_error_channel_is_broken(false) in both nydusd logger setup paths.

Test Results

  • cargo fmt --check
  • cargo check --locked -p nydus-rs
  • cargo test -p nydus-rs logger::tests
  • I also reran the ENOSPC repro from [Bug] nydusd API hangs after ENOSPC #1958:
    • put blob cache, log file, stdout, and stderr on the same 512 MiB ext4 filesystem
    • filled it to 100%
    • read a real file from the mounted image
    • /api/v1/daemon still returned while the filesystem was full
    • /api/v1/daemon also returned after space was freed

Change Type

  • Bug Fix
  • Feature Addition
  • Documentation Update
  • Code Refactoring
  • Performance Improvement
  • Other (please describe)

Self-Checklist

  • I have run a code style check and addressed any warnings/errors.
  • I have added appropriate comments to my code (if applicable).
  • I have updated the documentation (if applicable).
  • I have written appropriate unit tests.

Signed-off-by: chengyue <yue.cheng.ted@gmail.com>
@tedcy
tedcy requested review from a team, Desiki-high, adam3q and power-more and removed request for a team June 15, 2026 10:28
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.76%. Comparing base (05c863f) to head (69c1983).

Files with missing lines Patch % Lines
src/logger.rs 50.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1964      +/-   ##
==========================================
+ Coverage   68.52%   72.76%   +4.24%     
==========================================
  Files         210      210              
  Lines       63071    63073       +2     
  Branches    55826    55828       +2     
==========================================
+ Hits        43218    45896    +2678     
+ Misses      18046    15104    -2942     
- Partials     1807     2073     +266     
Files with missing lines Coverage Δ
src/logger.rs 80.16% <50.00%> (+5.87%) ⬆️

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Zephyrcf Zephyrcf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Zephyrcf
Zephyrcf merged commit 396d6e4 into dragonflyoss:master Jun 15, 2026
34 of 35 checks passed
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.

[Bug] nydusd API hangs after ENOSPC

2 participants