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: check health too long when dfdaemon is unavailable #344

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

Louhwz
Copy link
Contributor

@Louhwz Louhwz commented Jun 16, 2021

Description

  1. Use for loop with buffered channel and time.After to control timeout
  2. refactor some redundant log and variable

Related Issue

#343

Motivation and Context

  1. When dfdaemon is unavailable, dfget will stuck in health checking for a long time. This will slow downloading task.

Screenshots (if appropriate):

Now timeout works.
image

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.

@Louhwz Louhwz requested a review from a team as a code owner June 16, 2021 03:55
@Louhwz Louhwz requested review from jim3ma, ansinlee and 244372610 June 16, 2021 03:55
@yxxhero
Copy link
Member

yxxhero commented Jun 16, 2021

@Louhwz You only have one commit incorrectly signed off! Please fix it.

@Louhwz
Copy link
Contributor Author

Louhwz commented Jun 16, 2021

@Louhwz You only have one commit incorrectly signed off! Please fix it.

thanks

@Louhwz Louhwz marked this pull request as draft June 16, 2021 10:25
@Louhwz Louhwz force-pushed the fix/check_health_too_long branch from 24b944f to 2fe459a Compare June 16, 2021 10:52
@Louhwz Louhwz marked this pull request as ready for review June 16, 2021 10:58
cmd/dfget/cmd/root.go Show resolved Hide resolved
Copy link
Member

@jim3ma jim3ma 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-commenter
Copy link

codecov-commenter commented Jun 17, 2021

Codecov Report

Merging #344 (2fe459a) into main (a28a812) will increase coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #344      +/-   ##
==========================================
+ Coverage   41.12%   41.26%   +0.14%     
==========================================
  Files          61       61              
  Lines        4832     4832              
==========================================
+ Hits         1987     1994       +7     
+ Misses       2595     2587       -8     
- Partials      250      251       +1     
Flag Coverage Δ
unittests 41.26% <ø> (+0.14%) ⬆️

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

Impacted Files Coverage Δ
client/daemon/peer/peertask_base.go 34.46% <0.00%> (+1.69%) ⬆️

@jim3ma jim3ma merged commit 41599d6 into dragonflyoss:main Jun 18, 2021
gaius-qi pushed a commit that referenced this pull request Jun 28, 2023
e-ngo pushed a commit to e-ngo/dragonfly that referenced this pull request Jan 23, 2025
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.

5 participants