Skip to content

Make detailed find and info agree on duplicate Drive paths #421

Done

Description

@shcheklein

A detailed recursive listing can choose a different Drive item than info() for the same logical path. The discrepancy was reproduced on main and on #420.

Reproduction

  1. Create two Drive folders named dup under the same root, each containing a folder named a.
  2. In one a, create a folder named x. In the other, create a file named x. Give the folder the lower ID in a simulated transport.
  3. Call fs.find("root"), then compare fs.find("root/dup/a", withdirs=True, detail=True)["root/dup/a/x"]["type"] with fs.info("root/dup/a/x")["type"].

The detailed listing can return file while info() returns directory. The detailed listing currently keeps the last entry for a path. info() selects the lowest matching Drive ID. Traversal order can change after warming the cache.

Expected behavior

Choose the same item for a shared path across cold and warm detailed listings and info() when both files and folders are requested. Cover the case with a public filesystem test and measure peak memory on a wide traversal. The initial proposal kept an ID for every output path and increased peak RSS from 162 to 179 MiB for 262,144 files in the reviewer's simulated workload. A solution that limits additional state to ambiguous paths is worth investigating.

Reproduction, example test, and measurements

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions