holepunchto / hyperdrive

Hyperdrive is a secure, real time distributed file system
Apache License 2.0
1.86k stars 134 forks source link

readdir() w/recursive=true needs to handle mount-cycles and large mount-graphs #259

Closed pfrazee closed 1 year ago

pfrazee commented 4 years ago

Currently if you have a "mount cycle" (2 drives that mount each other) the readdir() call with {recursive: true} will enter an endless loop.

Even without a cycle, mount-graphs have the potential to become so large that recursion is not feasible. (E.g. Beaker's use of mounts for the social graph could cause a recursive readdir to iterate the "strong set.")

Ways we can solve this:

Ways we can't solve this:

I personally prefer either the mountDepth option or not recursing into mounts.

jb33k commented 4 years ago

Is this related to https://github.com/mafintosh/hyperdrive/issues/258?

pfrazee commented 4 years ago

It doesn't look like it, the test case in #257 doesn't use recursive readdir