Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

refactor: handle errors gracefully #1085

Merged
merged 1 commit into from
Nov 19, 2019
Merged

Conversation

starnop
Copy link
Contributor

@starnop starnop commented Nov 19, 2019

Signed-off-by: Starnop [email protected]

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added kind/bug This is bug report for project kind/refactor size/S labels Nov 19, 2019
dfget/core/core.go Outdated Show resolved Hide resolved
Copy link
Member

@lowzj lowzj left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-io
Copy link

Codecov Report

Merging #1085 into master will decrease coverage by 0.04%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1085      +/-   ##
==========================================
- Coverage   47.33%   47.29%   -0.05%     
==========================================
  Files         118      118              
  Lines        7216     7223       +7     
==========================================
  Hits         3416     3416              
- Misses       3532     3539       +7     
  Partials      268      268
Impacted Files Coverage Δ
supernode/daemon/mgr/scheduler/manager.go 22.6% <0%> (ø) ⬆️
supernode/daemon/mgr/progress/progress_delete.go 0% <0%> (ø) ⬆️
dfget/core/core.go 42.3% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9017881...d64938d. Read the comment docs.

@lowzj lowzj merged commit ac262d5 into dragonflyoss:master Nov 19, 2019
starnop pushed a commit to starnop/Dragonfly that referenced this pull request Nov 27, 2019
inoc603 pushed a commit to inoc603/Dragonfly that referenced this pull request Dec 23, 2019
sungjunyoung pushed a commit to sungjunyoung/Dragonfly that referenced this pull request May 8, 2022
…flyoss#1085)

When a peer leaves, it calls scheduler's LeaveTask() interface to
notify scheduler that it's leaving. And LeaveTask() will re-schedule
all its children to find a new parent by calling ScheduleParent().

But some of this peer's children might be in PeerStateSucceeded
state, as they have finished downloading tasks from parent. So
ScheduleParent() on such children is pointless.

Let's delete peer's parent on PeerEventDownloadSucceeded event, so
its parent won't call ScheduleParent() on it again, when its parent
is leaving.

Signed-off-by: Eryu Guan <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug This is bug report for project kind/refactor size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants