Skip to content

fix(backend): use full error chain in stream read failures - #1861

Merged
gaius-qi merged 1 commit into
dragonflyoss:mainfrom
pmady:fix/stream-error-chain
Jun 2, 2026
Merged

fix(backend): use full error chain in stream read failures#1861
gaius-qi merged 1 commit into
dragonflyoss:mainfrom
pmady:fix/stream-error-chain

Conversation

@pmady

Copy link
Copy Markdown
Contributor

Description

The map_err closures in get() across all three backends walk the error source chain into a chain string but then pass the original err to IOError::new() instead of chain. The full error context gets computed and thrown away.

Fixes http, hugging_face, and model_scope backends.

Motivation and Context

When a stream read fails mid-download, the IOError only contains the top-level message. Nested causes (DNS, TLS, connection reset, etc.) are lost. This makes debugging download failures harder than it needs to be.

The map_err closures in get() walk the error source chain into a
string but then pass the original error to IOError::new instead of
the chain. Fix all three backends (http, hugging_face, model_scope).
Signed-off-by: pmady <pavan4devops@gmail.com>
@codecov

codecovBot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.09%. Comparing base (f1ce94b) to head (24ba736).
⚠️ Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
dragonfly-client-backend/src/http.rs0.00%1 Missing ⚠️
dragonfly-client-backend/src/hugging_face.rs0.00%1 Missing ⚠️
dragonfly-client-backend/src/model_scope.rs0.00%1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@## main #1861 +/- ##
==========================================
- Coverage 44.11% 44.09% -0.03% 
==========================================
Files 93 93 Lines 27564 27564 ==========================================
- Hits 12161 12154 -7 - Misses 15403 15410 +7 
Files with missing linesCoverage Δ
dragonfly-client-backend/src/http.rs96.09% <0.00%> (ø)
dragonfly-client-backend/src/hugging_face.rs40.14% <0.00%> (ø)
dragonfly-client-backend/src/model_scope.rs46.74% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

@gaius-qigaius-qi added the enhancement New feature or request label Jun 2, 2026
@gaius-qigaius-qi added this to the v2.5.0 milestone Jun 2, 2026

@gaius-qigaius-qi 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

@gaius-qi
gaius-qi enabled auto-merge (squash) June 2, 2026 06:34
@gaius-qi
gaius-qi disabled auto-merge June 2, 2026 06:34
@gaius-qi
gaius-qi merged commit 0173700 into dragonflyoss:mainJun 2, 2026
8 of 9 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pmady@gaius-qi