Skip to content

Show progress while upload loads the description file and finds the files - #952

Open
caglarpir wants to merge 1 commit into
mapillary:mainfrom
caglarpir:pre-upload-progress
Open

caglarpir wants to merge 1 commit into
mapillary:mainfrom
caglarpir:pre-upload-progress

Conversation

@caglarpir

@caglarpir caglarpir commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Before the first checksum, upload validated every entry of the description file and searched the import paths three times (images, videos, zip files), resolving every path found twice, all without output. With 100,000 images on an SSD that took about 12 seconds, and longer on network drives, so it could look stuck.

  • Loading the description file shows a progress bar.
  • The import paths are searched once for all file types, with a counter of the files looked at.
  • Paths are resolved with each folder resolved once (utils.PathResolver). The result is the same as Path.resolve(): a file that is a link is still resolved in full, and on Windows every path is, as resolving there also gives file names the case they have on the drive. Errors checking a file for a link are ignored, as Path.resolve() ignores them (os.path.islink(), not Path.is_symlink(), which raises them before Python 3.14), such as for a file in a folder that can be listed but not searched.

check_upload_history loads and finds files the same way, so it shows the same progress on stderr. Its JSON on stdout is unchanged.

Measured on a Mac SSD with 100,000 images: finding the files went from 7.2 s to 2.3 s. Validating the entries still takes about 5 s, now with the progress shown.

Tests: the new candidate tests pass on main too (same results, including links, overlapping import paths and relative paths), and tests check PathResolver against Path.resolve(), including a folder that can be listed but not searched (run on Python 3.9, 3.13 and 3.14).

@meta-cla meta-cla Bot added the cla signed label Nov 16, 2026
…iles

Before the first checksum, upload validated every entry of the description
file and searched the import paths three times (images, videos, zip files),
resolving every path found twice, all without output. With 100,000 images on
an SSD that took about 12 seconds, and longer on network drives.

- Loading the description file shows a progress bar.
- The import paths are searched once for all file types, with a counter of
  the files looked at.
- Paths are resolved with each folder resolved once (utils.PathResolver).
  The result is the same as Path.resolve(): a file that is a link is still
  resolved in full, and on Windows every path is, as resolving there also
  gives file names the case they have on the drive. Errors checking a file
  for a link are ignored, as Path.resolve() ignores them, such as for a file
  in a folder that can be listed but not searched.

check_upload_history loads and finds files the same way, so it shows the
same progress on stderr. Its JSON on stdout is unchanged.

On a Mac SSD with 100,000 images, finding the files went from 7.2 s to
2.3 s. Validating the entries still takes about 5 s, now with the progress
shown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant