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

[copier] minor clean up to copier #13820

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

danking
Copy link
Contributor

@danking danking commented Oct 16, 2023

  1. File rate is more interesting for small files.
  2. The source_report controls the progress bar. By updating it eagerly while we are listing a directory, the progress bar is more accurate sooner. We currently wait until we get a semaphore for a particular file to update the progress bar.

1. File rate is more interesting for small files.
2. The source_report controls the progress bar. By updating it eagerly while we are listing a directory, the progress bar is more accurate sooner. We currently wait until we get a semaphore for a particular file to update the progress bar.
jigold
jigold previously requested changes Oct 16, 2023
hail/python/hailtop/aiotools/fs/copier.py Show resolved Hide resolved
async for srcentry in srcentries]
copy_thunks = []
async for srcentry in srcentries:
bytes_to_copy += await (await srcentry.status()).size() # this is almost never a syscall/net-request (afaik: only local symlinks)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the end of this comment. What do you mean this does a symlink?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Getting the status and the size of an entry of a directory listing, AFAICT, only requires a system call or network request in one special case:

  1. You have a LocalFS
  2. The file in question is a symlink.

Linux doesn't eagerly retrieve the size of the target of a symlink (I think because it could be an arbitrary number of symlinks away).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why status and size are async. If it wasn't for the local fs, they could be sync.

Maybe a better comment is:

In cloud FSes, status and size never make a network request. In local FS, they can make system calls on symlinks. This line will be fairly expensive if copying a tree with a lot of symlinks.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a better comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks!

@danking danking merged commit f0328b6 into hail-is:main Oct 17, 2023
8 checks passed
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 this pull request may close these issues.

2 participants