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

Problems with batch actions #573

Open
Gongui opened this issue Dec 15, 2020 · 3 comments
Open

Problems with batch actions #573

Gongui opened this issue Dec 15, 2020 · 3 comments

Comments

@Gongui
Copy link

Gongui commented Dec 15, 2020

  1. When running batch actions (example: play/pause) AriaNg makes a request for each one of them.
    The problem is that all requests are made at the same time and some devices like rpi will take a while to process them (x10 if you use https as protocol).
    While the requests are being processed, the user only sees a "loading..." message (and the browser tab usually freezes) and going away from that page makes the pending requests to fail.

A solution for that would be using a queue, running a limited number of requests at a time, something like 20 would work and showing a progress bar.

  1. When running actions like play and pause, AriaNg makes a request to play/pause a task even if it has the desired state. That extra (and unnecessary) request fails with a 4xx status.

  2. While running a batch action on more than 1000 tasks, only the first 1000 tasks get processed.

@mayswind
Copy link
Owner

mayswind commented Dec 15, 2020

1, aria2 supports "system.multicall" rpc method to request multi methods one time. I think it's better to use "system.multicall" instead of using a queue to request, because client does not know the capacity of server. I think someone can submit pr to improve it.
2, I'm agree with you, AriaNg should skip the tasks which state is expected. I think someone can submit pr to improve it too. By the way, AriaNg would show running tasks and paused tasks in different pages, so I think most people would not meet this problem in general.
3, AriaNg does not have limitation of task count of batch action, but AriaNg only gets first 1,000 tasks in task list page. AriaNg thinks 1,000 tasks are enough for most people, and getting all tasks in a loop would make AriaNg more complex.

@Gongui
Copy link
Author

Gongui commented Dec 16, 2020

AriaNg would show running tasks and paused tasks in different pages, so I think most people would not meet this problem in general.

The problem happens on the Waiting page that contains tasks in waiting and paused states.

I just modified the code to solve problems 1 and 2, will submit a pr later.

About problem 3: What about adding an option to let the user change that limit?

@mayswind
Copy link
Owner

mayswind commented Dec 16, 2020

@Gongui I think the problem can be solved temporarily by adding an option to modify the limitation of getting tasks. But it is not a good solution. If user would change the limitation, other problem may occur (like performance problem even unavailable problem). I think 1,000 tasks can meet the requirement of most people.
If AriaNg does not meet the requirement of user, I would rather that user did'nt use AriaNg than using a version that may have other problem.
I'm glad to see other 2 problem would be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants