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

dfdaemon: specify context when invokes dfget #1041

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

zhouhaibing089
Copy link
Contributor

This change is meant to fix #997. The dfget process is supposed to
be terminated when client closes the connection.

@codecov-io
Copy link

Codecov Report

Merging #1041 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1041      +/-   ##
==========================================
- Coverage    46.7%   46.69%   -0.02%     
==========================================
  Files         115      115              
  Lines        7029     7029              
==========================================
- Hits         3283     3282       -1     
  Misses       3490     3490              
- Partials      256      257       +1
Impacted Files Coverage Δ
supernode/daemon/mgr/scheduler/manager.go 21.91% <0%> (-0.69%) ⬇️

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 e51ade6...2d4b579. Read the comment docs.

@@ -16,11 +16,16 @@

package downloader

import "context"

// Interface specifies on how an plugin can download a file.
type Interface interface {
// Download download url file to file name
// return dst path and download error
Download(url string, header map[string][]string, name string) (string, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if we could directly remove Download(url string, header map[string][]string, name string) (string, error) . @starnop @yeya24 @lowzj

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed. I'm hesitate to rename back to Download as it is not future-proof yet(I mean, I'm not certain that every implementation can be implemented with Context).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to rename back to Download. 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

@zhouhaibing089 WDYT? And can we make it move on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to keep it as it is just like exec.Command and exec.CommandContext unless you are strong on it.

@starnop
Copy link
Contributor

starnop commented Oct 30, 2019

releated #1038

also cc/ @zcc35357949

This change is meant to fix dragonflyoss#997. The dfget process is supposed to
be terminated when client closes the connection.

Signed-off-by: zhouhaibing089 <[email protected]>
@starnop
Copy link
Contributor

starnop commented Nov 7, 2019

LGTM.

@allencloud allencloud merged commit ed3f409 into dragonflyoss:master Nov 7, 2019
starnop pushed a commit to starnop/Dragonfly that referenced this pull request Nov 27, 2019
dfdaemon: specify context when invokes dfget
inoc603 pushed a commit to inoc603/Dragonfly that referenced this pull request Dec 23, 2019
dfdaemon: specify context when invokes dfget
sungjunyoung pushed a commit to sungjunyoung/Dragonfly that referenced this pull request May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dfdaemon calls dfget and zombie mileage occurs
5 participants