[fix] Improve upload retry resilience#292
Conversation
Give stale pre-downscale slices a larger retry timeout budget and stop sibling upload workers promptly after fatal upload failures. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improve upload retry resilience by increasing timeout budgets for stale slices, tightening slice queue backpressure, and canceling sibling upload workers after fatal failures.
Changes:
- Introduce
UploadAttemptTimeoutPolicyand unit tests to compute per-attempt upload timeouts with stale-slice penalties and ceilings. - Reduce
FileUploadCoordinatorchannel capacity to apply tighter backpressure so new slices reflect adaptive chunk sizing sooner. - Cancel sibling workers on fatal failures by canceling the shared
CancellationTokenSourceand adding early-exit handling in workers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Uploading/UploadAttemptTimeoutPolicyTests.cs | Adds unit tests covering new timeout policy behavior (floor, retry growth, stale-slice penalty, ceiling). |
| tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Uploading/FileUploadWorkerTests.cs | Adds tests for retrying client timeouts and canceling sibling workers on failure; updates adaptive controller defaults. |
| tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Uploading/FileUploadCoordinatorTests.cs | Adds a test asserting bounded channel backpressure with reduced capacity. |
| src/ByteSync.Client/Services/Communications/Transfers/Uploading/UploadAttemptTimeoutPolicy.cs | New policy encapsulating timeout computation with stale-slice retry budgeting. |
| src/ByteSync.Client/Services/Communications/Transfers/Uploading/FileUploadWorker.cs | Switches timeout computation to new policy, adds cancellation logic to stop sibling workers after fatal errors, enhances logging. |
| src/ByteSync.Client/Services/Communications/Transfers/Uploading/FileUploadCoordinator.cs | Reduces channel capacity from 8 to 2 to tighten backlog/backpressure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolve PR feedback by bounding timeout calculations, disposing queued slices after fatal upload failures, and fixing targeted Sonar issues. Made-with: Cursor
Cover FileSlicer cancellation cleanup paths and address the async disposal warning reported by SonarCloud. Made-with: Cursor
Let adaptive upload timeouts control storage uploads and classify client-side transport resets so slow, unstable connections downscale instead of surfacing as server failures. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Made-with: Cursor
|



Summary
Test plan
dotnet build ByteSync.sln --artifacts-path ".artifacts/pr3-build-output"dotnet test tests/ByteSync.Client.UnitTests/ByteSync.Client.UnitTests.csproj --artifacts-path ".artifacts/pr3-test-output"dotnet test tests/ByteSync.Client.IntegrationTests/ByteSync.Client.IntegrationTests.csproj --filter Upload_SliceAndParallelism_Tests --artifacts-path ".artifacts/pr3-integration-output"Made with Cursor