Skip to content

Comments

prevent BrokenResourceError message during normal stream connection teardown#257

Open
evakhoni wants to merge 1 commit intojumpstarter-dev:mainfrom
evakhoni:fix-steam-warning
Open

prevent BrokenResourceError message during normal stream connection teardown#257
evakhoni wants to merge 1 commit intojumpstarter-dev:mainfrom
evakhoni:fix-steam-warning

Conversation

@evakhoni
Copy link
Contributor

@evakhoni evakhoni commented Feb 23, 2026

in #247, we're no longer suppressing BrokenResourceError, however during a normal stream connection teardown, the exception occurs with an BrokenPipeError which afaik is expected in this case, causing a warning that is repeated at the end of every connection over and over:

[02/23/26 14:32:05] WARNING  WARNING:jumpstarter.streams.common:stream copy    common.py:30
                             interrupted (BrokenResourceError):                            

this PR is excluding the specific condition from the warning, while preserving other potentially useful messages.

discussed in #256

Summary by CodeRabbit

  • Bug Fixes
    • Improved error logging to reduce unnecessary log noise during normal shutdown scenarios while preserving detailed diagnostic information for actual errors.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bacfa00 and a2ef43d.

📒 Files selected for processing (1)
  • python/packages/jumpstarter/jumpstarter/streams/common.py

📝 Walkthrough

Walkthrough

Exception handling in the copy_stream function now differentiates BrokenPipeError from other exceptions, applying debug-level logging for normal teardown scenarios while preserving warning-level logs with root cause details for other error types. The change refines log verbosity without altering the core exception handling flow.

Changes

Cohort / File(s) Summary
Exception Handling Refinement
python/packages/jumpstarter/jumpstarter/streams/common.py
Modified exception handling in copy_stream to distinguish BrokenPipeError with debug-level logging while maintaining warning-level logs with root cause inspection for other exceptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A gentle change in error's way,
BrokenPipes now whisper, not cry out!
The logs stay quiet, warnings at bay,
Less noise, more grace—what debugging's about! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: preventing a BrokenResourceError message during normal stream teardown, which matches the PR's core objective of reducing log verbosity for expected error conditions.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@evakhoni evakhoni requested a review from bennyz February 23, 2026 13:52
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.

1 participant