Skip to content

Commit d586be0

Browse files
authored
fix: Undo release of all resources in managed writer (#801)
Our latest guideline is that plugins are responsible for releasing their resources.
1 parent 9c65f67 commit d586be0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

plugins/destination/managed_writer.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ func (p *Plugin) flush(ctx context.Context, metrics *Metrics, table *arrow.Schem
7070
p.logger.Info().Str("table", tableName).Int("len", batchSize).Dur("duration", time.Since(start)).Msg("batch written successfully")
7171
atomic.AddUint64(&metrics.Writes, uint64(batchSize))
7272
}
73-
for _, r := range resources {
74-
r.Release()
75-
}
7673
}
7774

7875
func (*Plugin) removeDuplicatesByPK(table *arrow.Schema, resources []arrow.Record) []arrow.Record {
@@ -95,7 +92,7 @@ func (*Plugin) removeDuplicatesByPK(table *arrow.Schema, resources []arrow.Recor
9592
res = append(res, r)
9693
continue
9794
}
98-
// duplicate, release early
95+
// duplicate, release
9996
r.Release()
10097
}
10198

0 commit comments

Comments
 (0)