Skip to content

[fix] Improve stale upload slice resilience#293

Merged
paul-fresquet merged 4 commits intomasterfrom
fix/upload-stale-slice-resilience
May 1, 2026
Merged

[fix] Improve stale upload slice resilience#293
paul-fresquet merged 4 commits intomasterfrom
fix/upload-stale-slice-resilience

Conversation

@paul-fresquet
Copy link
Copy Markdown
Contributor

Summary

  • Increase first-attempt timeout budgets for oversized stale upload slices based on the current adaptive chunk size.
  • Downscale upload settings more aggressively after client timeout/network failures by returning to minimum parallelism and halving chunk size.
  • Classify Windows socket operation-aborted failures as client network errors and add targeted diagnostic logging for slice/chunk ratio.

Test plan

  • dotnet test "tests/ByteSync.Client.UnitTests/ByteSync.Client.UnitTests.csproj" --filter "FullyQualifiedNameUploadAttemptTimeoutPolicyTests|FullyQualifiedNameAdaptiveUploadControllerTests|FullyQualifiedName~UploadFailureClassifierTests"
  • git diff --check

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves resiliency of upload attempts when slices become “oversized” relative to the current adaptive chunk size, and makes adaptive downscaling more aggressive on client-side failures.

Changes:

  • Revise upload attempt timeout computation to immediately budget more time for oversized slices based on current chunk size, with bounded retry growth.
  • Downscale more aggressively after repeated client timeout/network failures by resetting parallelism to minimum and halving chunk size.
  • Classify SocketError.OperationAborted as a client network error and add diagnostic logging for slice/chunk ratio.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ByteSync.Client/Services/Communications/Transfers/Uploading/UploadAttemptTimeoutPolicy.cs Changes timeout computation to use an oversized-slice heuristic tied to current chunk size.
src/ByteSync.Client/Services/Communications/Transfers/Uploading/FileUploadWorker.cs Adds debug logging for slice-to-chunk ratio to aid diagnostics.
src/ByteSync.Client/Services/Communications/Transfers/Uploading/AdaptiveUploadController.cs Adds a dedicated, more aggressive downscale path for client network issues/timeouts.
src/ByteSync.Client/Services/Communications/Transfers/Strategies/UploadFailureClassifier.cs Treats OperationAborted socket failures as client network errors.
tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Uploading/UploadAttemptTimeoutPolicyTests.cs Updates/extends unit tests for the new timeout behavior.
tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Uploading/AdaptiveUploadControllerTests.cs Updates expectations for the new client-failure downscale behavior.
tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Strategies/UploadFailureClassifierTests.cs Adds coverage for OperationAborted socket classification.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Allow large stale upload slices to use a higher timeout ceiling without raising the normal upload retry budget.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Centralize the transport-closure message fallback and cover the known runtime variants while keeping structured socket checks first.

Made-with: Cursor
@sonarqubecloud
Copy link
Copy Markdown

@paul-fresquet paul-fresquet merged commit 397a1d1 into master May 1, 2026
24 checks passed
@paul-fresquet paul-fresquet deleted the fix/upload-stale-slice-resilience branch May 1, 2026 04:21
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.

2 participants