Skip to content

Commit

Permalink
Fix panic in the sftp input (#3209)
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Todor <[email protected]>
  • Loading branch information
mihaitodor authored Feb 25, 2025
1 parent 6bc994c commit 36a54a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ All notable changes to this project will be documented in this file.
- Fixed a bug with the `redpanda_migrator_offsets` input and output where the consumer group update migration logic based on timestamp lookup should no longer skip ahead in the destination cluster. This should enforce at-least-once delivery guarantees. (@mihaitodor)
- The `redpanda_migrator_bundle` output no longer drops messages if either the `redpanda_migrator` or the `redpanda_migrator_offsets` child output throws an error. Connect will keep retrying to write the messages and apply backpressure to the input. (@mihaitodor)
- Transient errors in `snowflake_streaming` are now automatically retried in cases it's determined to be safe to do. (@rockwotj)

- Fixed a panic in the `sftp` input when Connect shuts down. (@mihaitodor)

### Changed

Expand Down
6 changes: 6 additions & 0 deletions internal/impl/sftp/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,15 @@ func (s *sftpReader) Close(ctx context.Context) error {
defer s.stateLock.Unlock()

s.closeScanner(ctx)

if s.client == nil {
return nil
}

if err := s.client.Close(); err != nil {
s.log.With("error", err).Error("Failed to close client")
}

return nil
}

Expand Down

0 comments on commit 36a54a7

Please sign in to comment.