Skip to content

Stop leaked logger in Finally block#472

Merged
cole-h merged 1 commit into
mainfrom
stop-leaked-logger
May 26, 2026
Merged

Stop leaked logger in Finally block#472
cole-h merged 1 commit into
mainfrom
stop-leaked-logger

Conversation

@cole-h

@cole-h cole-h commented May 22, 2026

Copy link
Copy Markdown
Member

The logger needs to be manually stopped because it is being leaked.

Backport of NixOS#15905.

Motivation

Context

Summary by CodeRabbit

  • Bug Fixes
    • Improved logging subsystem shutdown to ensure proper cleanup during application exit and error conditions.

Review Change Stack

The logger needs to be manually stopped because it is being leaked.

Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87999320-db6d-4cb1-8419-b42b2d1687a4

📥 Commits

Reviewing files that changed from the base of the PR and between 11f3aff and 4da1787.

📒 Files selected for processing (1)
  • src/nix/main.cc

📝 Walkthrough

Walkthrough

The PR adds a Finally scope-exit guard in mainWrapped() to call logger->stop(), ensuring the logging subsystem is properly shut down when the function exits, including on early returns and exception paths.

Changes

Logger Lifecycle Management

Layer / File(s) Summary
Logger shutdown on scope exit
src/nix/main.cc
A Finally guard is added to mainWrapped() that invokes logger->stop() when the function scope exits, guaranteeing clean logger termination.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A logger bids farewell so clean,
With Finally standing in between,
No leaks will creep, no threads will stray,
The logs shut down in graceful way! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a Finally block to stop the logger, which directly relates to the code modification in src/nix/main.cc.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stop-leaked-logger

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 22, 2026 21:51 Inactive
@cole-h cole-h enabled auto-merge May 22, 2026 21:56
@cole-h cole-h added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit 5d4c99f May 26, 2026
29 checks passed
@cole-h cole-h deleted the stop-leaked-logger branch May 26, 2026 09:49
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.

3 participants