8000 Upload length is wrong after pausing and unpausing · Issue #1486 · aria2/aria2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upload length is wrong after pausing and unpausing #1486

New issue

Have a question about this project? Sign up for a free GitH 8000 ub 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

Closed
sbruder opened this issue Oct 11, 2019 · 1 comment · Fixed by #1487
Closed

Upload length is wrong after pausing and unpausing #1486

sbruder opened this issue Oct 11, 2019 · 1 comment · Fixed by #1487

Comments

@sbruder
Copy link
sbruder commented Oct 11, 2019

Expected Behavior

Aria2 should not change the amount of uploaded data the RPC returns when the torrent is paused and then unpaused again.

Current Behavior

Aria2 adds the amount uploaded in the current session to the uploaded amount (which already includes the current session) which distorts this metric making it unable to rely on.

Steps to Reproduce

  1. Add a torrent to aria2 (preferably one noone else is seeding/downloading)
  2. Download this torrent (or just a part of it) from a different instance.
  3. Get the uploaded amount from the RPC (uploadLength)
  4. Pause the torrent
  5. Unpause it again
  6. Get the uploaded amount

The second time the uploaded amount is queried from the RPC it will be doubled from the first time. When trying steps 2 – 6 in a new session (with the same metadata file using --force-save) the amount will increase by the amount of data uploaded in the new session.

This is how I did it:

$ curl -s -X POST -d '{"jsonrpc": "2.0", "id": "", "method": "aria2.tellActive"}' http://localhost:6800/jsonrpc | jq '.result[] | .gid,.uploadLength' 
"9aff7e0f2c3d88cb"
"2031616"
$ # downloading the file from a different instance
$ curl -s -X POST -d '{"jsonrpc": "2.0", "id": "", "method": "aria2.tellActive"}' http://localhost:6800/jsonrpc | jq '.result[] | .gid,.uploadLength'
"9aff7e0f2c3d88cb"
"2179779"
$ curl -s -X POST -d '{"jsonrpc": "2.0", "id": "", "method": "aria2.pause", "params": ["9aff7e0f2c3d88cb"]}' http://localhost:6800/jsonrpc
{"id":"","jsonrpc":"2.0","result":"9aff7e0f2c3d88cb"}
$ curl -s -X POST -d '{"jsonrpc": "2.0", "id": "", "method": "aria2.unpause", "params": ["9aff7e0f2c3d88cb"]}' http://localhost:6800/jsonrpc 
{"id":"","jsonrpc":"2.0","result":"9aff7e0f2c3d88cb"}
$ curl -s -X POST -d '{"jsonrpc": "2.0", "id": "", "method": "aria2.tellActive"}' http://localhost:6800/jsonrpc | jq '.result[] | .gid,.uploadLength'
"9aff7e0f2c3d88cb"
"2327942"

My aria2 version is 1.34.0 (from debian testing).

tatsuhiro-t added a commit that referenced this issue Oct 12, 2019
This commit resets sessionDownloadLength and sessionUploadLength when
a download restarted (including unpause RPC method).

Fixes #1486
@tatsuhiro-t
Copy link
Collaborator

Thank you for letting us know about this bug. I think #1487 fixes it.

vijayanandnandam pushed a commit to vijayanandnandam/aria2 that referenced this issue Mar 26, 2021
This commit resets sessionDownloadLength and sessionUploadLength when
a download restarted (including unpause RPC method).

Fixes aria2#1486
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 a pull request may close this issue.

3 participants
@tatsuhiro-t @sbruder and others
0