Skip to content

Conversation

artembilan
Copy link
Member

@artembilan artembilan commented Aug 21, 2025

Fixes: #10137

When maxFetchSize > 0, the AbstractInboundFileSynchronizer performs unnecessary Session.list() every time.
Then we go over all those files to filter.
And only after filtering we apply the maxFetchSize.

  • Add a cache for remote directory entries in the AbstractInboundFileSynchronizer
  • Guard cache interaction with a DefaultLockRegistry per directory
  • Rework AbstractInboundFileSynchronizer.transferFilesFromRemoteToLocal() to filter all the entries of the Session.list() on a first call. If maxFetchSize > 0, cache the remaining remote files

@artembilan artembilan requested a review from cppwfs August 21, 2025 15:50
@artembilan artembilan changed the title GH-10137: Cache session.list result in the `AbstractInboundFileSync… GH-10137: Cache session.list result in the AbstractInboundFileSynchronizer Aug 21, 2025
Copy link
Contributor

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

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

Great work.

Just the usual nitpicks.

…InboundFileSynchronizer`

Fixes: spring-projects#10137

When `maxFetchSize > 0`, the `AbstractInboundFileSynchronizer` performs unnecessary
`Session.list()` every time.
Then we go over all those files to filter.
And only after filtering we apply the `maxFetchSize`.

* Add a cache for remote directory entries in the `AbstractInboundFileSynchronizer`
* Guard cache interaction with a `DefaultLockRegistry` per directory
* Rework `AbstractInboundFileSynchronizer.transferFilesFromRemoteToLocal()`
to filter all the entries of the `Session.list()` on a first call.
If `maxFetchSize > 0`, cache the remaining remote files
* Fix `AbstractRemoteFileSynchronizerTests` for professional variable names
@artembilan artembilan merged commit a4f96cc into spring-projects:main Aug 25, 2025
3 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.

Shouldn't list remote file server each time max-fetch-size is reached
2 participants