Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(scheduler): handle DownloadPieceFinishedRequest and DownloadPieceFailedRequest asynchronously #3847

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

gaius-qi
Copy link
Member

Description

This pull request includes a change to the scheduler/service/service_v2.go file to improve the handling of download piece requests by making the request handling asynchronous.

Concurrency improvements:

  • scheduler/service/service_v2.go: Modified the AnnouncePersistentCachePeer function to handle DownloadPieceFinishedRequest and DownloadPieceFailedRequest asynchronously using goroutines. This change ensures that the main thread is not blocked while handling these requests.

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@gaius-qi gaius-qi added the enhancement New feature or request label Feb 19, 2025
@gaius-qi gaius-qi added this to the v2.3.0 milestone Feb 19, 2025
@gaius-qi gaius-qi self-assigned this Feb 19, 2025
@gaius-qi gaius-qi requested a review from a team as a code owner February 19, 2025 15:45
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 35.14%. Comparing base (832bd52) to head (25a0f68).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scheduler/service/service_v2.go 0.00% 8 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3847      +/-   ##
==========================================
- Coverage   35.19%   35.14%   -0.06%     
==========================================
  Files         337      337              
  Lines       39280    39282       +2     
==========================================
- Hits        13825    13805      -20     
- Misses      24554    24576      +22     
  Partials      901      901              
Flag Coverage Δ
unittests 35.14% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scheduler/service/service_v2.go 46.54% <0.00%> (-0.05%) ⬇️

... and 6 files with indirect coverage changes

@gaius-qi gaius-qi merged commit 6f58ed0 into main Feb 19, 2025
27 checks passed
@gaius-qi gaius-qi deleted the feature/finished branch February 19, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant