dragonflyoss / Dragonfly2

Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project.
https://d7y.io
Apache License 2.0
2.12k stars 267 forks source link

feat: delete the host after host leave peers during host manager gc #3361

Closed BruceAko closed 1 week ago

BruceAko commented 2 weeks ago

Description

During host manager RunGC(), reclaim the host directly after host leave peers, as host's ConcurrentUploadCount may not be 0 when the host exits abnormally.

Related Issue

3350

Types of changes

Checklist

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 52.72%. Comparing base (8153e57) to head (2ed4d07).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361/graphs/tree.svg?width=650&height=150&src=pr&token=PUICJYSAT7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) ```diff @@ Coverage Diff @@ ## main #3361 +/- ## ========================================== + Coverage 52.68% 52.72% +0.03% ========================================== Files 192 192 Lines 20408 20410 +2 ========================================== + Hits 10752 10761 +9 + Misses 8854 8848 -6 + Partials 802 801 -1 ``` | [Flag](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | `52.72% <100.00%> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [scheduler/resource/host\_manager.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361?src=pr&el=tree&filepath=scheduler%2Fresource%2Fhost_manager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-c2NoZWR1bGVyL3Jlc291cmNlL2hvc3RfbWFuYWdlci5nbw==) | `86.66% <100.00%> (+0.45%)` | :arrow_up: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3361/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)