Dragonfly2 icon indicating copy to clipboard operation
Dragonfly2 copied to clipboard

Dfdaemon should leave task when dfget stop daemon with aliveTime.

Open gaius-qi opened this issue 3 years ago • 4 comments

Feature request:

  • Dfdaemon should leave task when dfget stop daemon with aliveTime.

https://github.com/dragonflyoss/Dragonfly2/blob/main/client/config/peerhost.go#L51

Use case:

UI Example:

gaius-qi avatar Jun 15 '22 07:06 gaius-qi

Do you want to slove this issue? @greenhandatsjtu

gaius-qi avatar Jun 17 '22 07:06 gaius-qi

Do you want to slove this issue? @greenhandatsjtu

Hi @gaius-qi , I would like to work on this issue! But I'm not sure what 'leave task' means? Also, I'll appreciate it if you could give me some instructions on how to implement it. Thanks.

greenhandatsjtu avatar Jun 17 '22 07:06 greenhandatsjtu

If the dfget daemon service is shutdown, it will actively call GRPC LeaveTask to notify the scheduler to release all the tasks that have been downloaded by the daemon, because this dfget daemon no longer provides services for other peers to download these tasks.

However, when only dfget is used, a daemon will be pulled up to survive for a period of time according to the AliveTime parameter. When the AliveTime is reached, daemon will be shutdown, but the GRPC LeaveTask is not called to notify the Scheduler to release the completed Task.

gaius-qi avatar Jun 17 '22 09:06 gaius-qi

If the dfget daemon service is shutdown, it will actively call GRPC LeaveTask to notify the scheduler to release all the tasks that have been downloaded by the daemon, because this dfget daemon no longer provides services for other peers to download these tasks.

However, when only dfget is used, a daemon will be pulled up to survive for a period of time according to the AliveTime parameter. When the AliveTime is reached, daemon will be shutdown, but the GRPC LeaveTask is not called to notify the Scheduler to release the completed Task.

Thanks for your instructions! I think I understand now, can you assign this issue to me? I'll try to fix it.

greenhandatsjtu avatar Jun 17 '22 09:06 greenhandatsjtu