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

fix: sync pieces hang #1221

Merged
merged 1 commit into from
Apr 2, 2022
Merged

fix: sync pieces hang #1221

merged 1 commit into from
Apr 2, 2022

Conversation

jim3ma
Copy link
Member

@jim3ma jim3ma commented Apr 2, 2022

Signed-off-by: Jim Ma [email protected]

Description

For legacy peers, when call SyncPieceTasks, we must receive at least one piece tasks.

If scheduler :

  1. send to peer A with peer packet, main peer: peer x, steal peers: B
  2. send to peer B with peer packet, main peer: peer x, steal peers: A

Both of peer A and peer B do not have any pieces, they will hang at receiving the first piece tasks.

So we need send an empty piece tasks to each others to avoid this hang bug.

Related Issue

Fix #1220

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

  • Code compiles correctly.
  • My code follows the code style of this project.
  • 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.
  • All new and existing tests passed.

@jim3ma jim3ma requested a review from a team as a code owner April 2, 2022 07:30
@jim3ma jim3ma requested review from ansinlee, cndoit18 and lucy-cl April 2, 2022 07:30
@codecov-commenter
Copy link

Codecov Report

Merging #1221 (b0c7ca8) into main (bdca38b) will increase coverage by 0.35%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1221      +/-   ##
==========================================
+ Coverage   46.05%   46.40%   +0.35%     
==========================================
  Files         133      133              
  Lines       10566    10568       +2     
==========================================
+ Hits         4866     4904      +38     
+ Misses       5154     5107      -47     
- Partials      546      557      +11     
Flag Coverage Δ
Object-compatibility-e2etests ?
e2etests ?
unittests 46.40% <71.42%> (+0.35%) ⬆️

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

Impacted Files Coverage Δ
client/daemon/rpcserver/rpcserver.go 37.90% <66.66%> (-0.25%) ⬇️
client/daemon/rpcserver/subscriber.go 47.82% <66.66%> (-1.74%) ⬇️
...ent/daemon/peer/peertask_piecetask_synchronizer.go 47.27% <100.00%> (+0.32%) ⬆️
client/daemon/peer/piece_broker.go 89.74% <0.00%> (-2.57%) ⬇️
client/daemon/peer/peertask_conductor.go 57.18% <0.00%> (+0.98%) ⬆️
client/daemon/peer/peertask_piecetask_poller.go 53.33% <0.00%> (+22.96%) ⬆️

Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

@jim3ma jim3ma merged commit c412d54 into main Apr 2, 2022
@jim3ma jim3ma deleted the fix/sync-pieces-hang branch April 2, 2022 07:57
gaius-qi pushed a commit that referenced this pull request Jun 28, 2023
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.

All dfdaemon download image from source
4 participants