Skip to content

fix(core): keep dangling symlink entries in list results - #8417

Merged
Xuanwo merged 2 commits into
apache:mainfrom
Mola-maker:fix/8412-dangling-symlink-list
Oct 31, 2026
Merged

Xuanwo merged 2 commits into
apache:mainfrom
Mola-maker:fix/8412-dangling-symlink-list

Conversation

@Mola-maker

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #8412.

Rationale for this change

The issue traces the omission to FsLister, but the entry is actually dropped one layer up. FsLister already reports a dangling symlink correctly: DirEntry::metadata does not follow links, so the entry leaves the fs service as EntryMode::Unknown (verified locally — a dangling symlink reaches the operator layer as Unknown).

The drop happens in CompleteLister (core/core/src/layers/complete.rs). It stats every Unknown entry to refine its mode, and the fs service's stat follows symlinks, so for a dangling symlink the stat returns NotFound and the lister treated that as "the entry is gone" and silently skipped it.

A completion stat that misses its target only means the mode cannot be refined. The entry came from the service's own listing a moment earlier, so it should be kept as listed rather than dropped.

What changes are included in this PR?

  • opendal-core (CompleteLister): when the completion stat for an Unknown entry returns NotFound, return the entry unchanged instead of dropping it. Other stat errors still propagate, and successful stats refine the mode exactly as before.
  • fs service: an operator-level regression test, test_list_includes_dangling_symlink, which lists a directory containing a dangling symlink through Operator and asserts the entry is present with EntryMode::Unknown. The test fails without the core change and passes with it.

Are there any user-facing changes?

Listing a directory that contains dangling symlinks now returns those entries with EntryMode::Unknown instead of silently omitting them, restoring the pre-regression behavior described in #8412. No API changes.

Breaking changes

AI Usage Statement

  • Harness: Muse
  • Model: Muse Spark
  • Effort: High
  • Role: The AI investigated the report, reproduced the omission at the operator level, identified that the drop happens in CompleteLister rather than in the fs lister, and implemented the fix and regression test with local verification (fs crate tests, opendal-core unit tests, and the fs behavior suite). The human author directed the work, reviewed the analysis, and remains responsible for the submission.

Verification

Local verification (fs crate tests, opendal-core unit tests, fs behavior suite):

@Mola-maker
Mola-maker requested a review from Xuanwo as a code owner October 18, 2026 16:36
@github-actions github-actions Bot added core releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 18, 2026
@Xuanwo
Xuanwo merged commit aaab30b into apache:main Oct 31, 2026
383 checks passed
@Mola-maker

Copy link
Copy Markdown
Contributor Author

appreciate

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

Labels

core releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs service lister silently omits dangling symlinks (regression from v0.50.2)

2 participants