Skip to content

fix(cas): handle client disconnect errors gracefully in download service#2882

Merged
migmartri merged 1 commit into
mainfrom
work/clever-deer
Mar 19, 2026
Merged

fix(cas): handle client disconnect errors gracefully in download service#2882
migmartri merged 1 commit into
mainfrom
work/clever-deer

Conversation

@migmartri

@migmartri migmartri commented Mar 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Add isClientDisconnect helper that detects client disconnections: context.Canceled, gRPC canceled status, ECONNRESET (connection reset by peer), and EPIPE (broken pipe)
  • Handle client disconnects gracefully in the HTTP download path (io.Copy to response writer) — previously these errors were logged as errors and sent to Sentry
  • Unify disconnect detection across all CAS download/upload paths (HTTP download, gRPC ByteStream Read, gRPC ByteStream Write) using the shared helper

Fixes #2883

Client disconnects (connection reset by peer, broken pipe) during HTTP
downloads were being logged as errors and reported to Sentry. These are
normal operational events that should be logged at info level instead.

Refs: PFM-5015
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri added the multiclaude Managed by multiclaude label Mar 18, 2026

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 4 files

@migmartri migmartri added the needs-human-input Blocked on human decision label Mar 18, 2026
@migmartri

Copy link
Copy Markdown
Member Author

All CI checks are green. This PR is blocked on branch protection — requires an approving review before merge. Ready for human approval.

@migmartri migmartri removed multiclaude Managed by multiclaude needs-human-input Blocked on human decision labels Mar 18, 2026
@migmartri migmartri added the multiclaude Managed by multiclaude label Mar 18, 2026
@migmartri migmartri merged commit d6886d6 into main Mar 19, 2026
15 checks passed
@migmartri migmartri deleted the work/clever-deer branch March 19, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiclaude Managed by multiclaude

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CAS download service logs client disconnections as errors and sends to Sentry

2 participants