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

rclone calls b2_authorize_account, b2_list_buckets twice unnecessarily #1640

Closed
jikamens opened this issue Aug 31, 2017 · 3 comments
Closed

Comments

@jikamens
Copy link

When I use rclone --fast-list=true check local-storage:path crypt-on-top-of-B2-storage:path, it calls b2_authorize_account and b2_list_buckets twice. Here are the first few API calls, captured with --dump-headers:

2017/08/31 19:07:05 DEBUG : GET /b2api/v1/b2_authorize_account HTTP/1.1
2017/08/31 19:07:06 DEBUG : POST /b2api/v1/b2_list_buckets HTTP/1.1
2017/08/31 19:07:06 DEBUG : POST /b2api/v1/b2_list_file_names HTTP/1.1
2017/08/31 19:07:06 DEBUG : GET /b2api/v1/b2_authorize_account HTTP/1.1
2017/08/31 19:07:07 DEBUG : POST /b2api/v1/b2_list_buckets HTTP/1.1
2017/08/31 19:07:07 DEBUG : POST /b2api/v1/b2_list_file_names HTTP/1.1
...lots more b2_list_file_names, followed by some b2_download_file_by_id...

The b2_authorize_account and b2_list_buckets calls are Class C transactions, i.e., the most expensive B2 transaction type. It would be preferable if they were only invoked once per invocation of rclone rather than twice.

@ncw
Copy link
Member

ncw commented Sep 1, 2017

This is to do with the crypt layer checking to see if the argument you passed in points to a file or not.

This isn't particularly easy to fix unfortunately. What it really needs is a Chroot call for a remote so the crypt layer would have to make a whole new remote (call NewFs) whichi s what calls the b2_authorize_account and b2_list_buckets. I made a new issue about Chroot #1644 to think about this.

$ rclone --fast-list ls b2secret: -vv --dump-headers 2>&1 | egrep 'GET|POST'
2017/09/01 10:11:02 DEBUG : GET /b2api/v1/b2_authorize_account HTTP/1.1
2017/09/01 10:11:02 DEBUG : POST /b2api/v1/b2_list_buckets HTTP/1.1
2017/09/01 10:11:03 DEBUG : POST /b2api/v1/b2_list_file_names HTTP/1.1
2017/09/01 10:11:03 DEBUG : GET /b2api/v1/b2_authorize_account HTTP/1.1
2017/09/01 10:11:03 DEBUG : POST /b2api/v1/b2_list_buckets HTTP/1.1
2017/09/01 10:11:04 DEBUG : POST /b2api/v1/b2_list_file_names HTTP/1.1
$ rclone --fast-list ls b2:rclone-secrets -vv --dump-headers 2>&1 | egrep 'GET|POST'
2017/09/01 10:11:15 DEBUG : GET /b2api/v1/b2_authorize_account HTTP/1.1
2017/09/01 10:11:16 DEBUG : POST /b2api/v1/b2_list_buckets HTTP/1.1
2017/09/01 10:11:16 DEBUG : POST /b2api/v1/b2_list_file_names HTTP/1.1

@ncw ncw added this to the Help Wanted milestone Aug 30, 2018
@ivandeex
Copy link
Member

Closing after 4 years of inactivity

@jikamens
Copy link
Author

This appears to have been fixed in the interim.

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

3 participants