Skip to content

Commit

Permalink
fix one other thing
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Oct 11, 2023
1 parent 396c6f0 commit 3393fba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ func (p *PostgresCDCSource) consumeStream(
cancel()
if err != nil {
if pgconn.Timeout(err) {
log.Infof("Idle timeout reached, returning currently accumulated records")
return result, nil
// TODO (kaushik): consider returning the records accumulated so far
// if last message seen was a commit, then we can return right away as well.
stopAtNextCommit = true
} else {
return nil, fmt.Errorf("ReceiveMessage failed: %w", err)
}
return nil, fmt.Errorf("ReceiveMessage failed: %w", err)
}

if errMsg, ok := rawMsg.(*pgproto3.ErrorResponse); ok {
Expand Down

0 comments on commit 3393fba

Please sign in to comment.