Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sftp refactor #3073

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Sftp refactor #3073

wants to merge 7 commits into from

Conversation

ooesili
Copy link
Contributor

@ooesili ooesili commented Dec 11, 2024

Before this commit, when a file was exuasted the ReadBatch method
returned ErrNotConnected which cause the engine to call Connect again.
Aside from being awkward, this causes the connection status to
incorrectly be reported as disconnected during normal operation.

This commit moves the logic to advance to the next file when the current
file is exhuasted into a the ReadBatch method.

Builds on top of #2435

This commit reduces the scope of critical sections guarded by scannerMut
to remove a deadlock that causes the last file to not be deleted when
the SFTP input is used with watching enabled.
`(*watcherPathProvider).Next()` currently uses recursion to loop until a
path is found. This commit refactors that function to use a for loop
instead which is more straight forward to read.
This integration test makes sure that when `delete_on_finish` is true
and watching is enabled that we delete every file.
Before this commit, when a file was exuasted the `ReadBatch` method
returned ErrNotConnected which cause the engine to call `Connect` again.
Aside from being awkward, this causes the connection status to
incorrectly be reported as disconnected during normal operation.

This commit moves the logic to advance to the next file when the current
file is exhuasted into a the ReadBatch method.
@ooesili ooesili added the inputs Any tasks or issues relating specifically to inputs label Dec 11, 2024
@ooesili ooesili self-assigned this Dec 11, 2024
@ooesili ooesili marked this pull request as ready for review December 12, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inputs Any tasks or issues relating specifically to inputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant