Skip to content

feat: make log output non-blocking - #117

Merged
rustatian merged 4 commits into
masterfrom
feat/nonblocking-logging
Oct 4, 2026
Merged

rustatian merged 4 commits into
masterfrom
feat/nonblocking-logging

Conversation

@rustatian

@rustatian rustatian commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Reason for This PR

Keep log calls responsive when the output reader is slow.

closes: roadrunner-server/roadrunner#2195

Description of Changes

  • Make asynchronous output the default for all logger formats and channels.
  • Queue up to 1,024 copied records in a buffered channel and discard new messages when it is full.
  • Start all output drains before waiting for shutdown. Report output errors.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

  • All commits in this PR are signed (git commit -s -S).
  • The reason for this PR is clearly provided.
  • The description of changes is clear and complete.
  • Required documentation changes are included.
  • User-facing changes are documented in README.md.
  • All added or changed functionality is tested.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 16:02
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.45%. Comparing base (d6f3c21) to head (9e54468).

Files with missing lines Patch % Lines
async_writer.go 95.91% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
+ Coverage   83.88%   87.45%   +3.57%     
==========================================
  Files           5        6       +1     
  Lines         242      295      +53     
==========================================
+ Hits          203      258      +55     
+ Misses         39       37       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Serial shutdown can starve healthy logger queues behind one blocked output.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds bounded asynchronous logging to prevent slow output readers from blocking application work.

Changes:

  • Adds a 1 MiB asynchronous output queue with drop/error reporting.
  • Adds deadline-aware shutdown draining.
  • Documents and tests asynchronous behavior.
File Description
README.md Documents buffering and shutdown behavior.
plugin.go Adds deadline-aware output shutdown.
logger.go Drains channel outputs on close.
config.go Wraps enabled outputs asynchronously.
async_writer.go Implements asynchronous queued writing.
async_writer_test.go Tests queuing, blocking, and shutdown.
format_handler_test.go Cleans up asynchronous output resources.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread plugin.go Outdated
@rustatian rustatian self-assigned this Oct 4, 2026
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian
rustatian merged commit dea62c8 into master Oct 4, 2026
8 checks passed
@rustatian
rustatian deleted the feat/nonblocking-logging branch October 4, 2026 19:39
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.

[💡 FEATURE REQUEST]: Non-blocking logging

2 participants