Skip to content

Commit 59a572e

Browse files
committed
physicalplan: fix minor leak with pooling of FlowSpecs
The only thing that we reuse when pooling `FlowSpec` objects is the capacity of `Processors` slice. Previously, we forgot to unset each element of that slice, so we could have hold onto to some processor specs which in turn could have hold onto some large objects (like `roachpb.Span`s in the TableReader) until a particular index of the slice is overwritten. This oversight is now fixed. Release note: None
1 parent a9e1061 commit 59a572e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/sql/physicalplan/specs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func ReleaseFlowSpec(spec *execinfrapb.FlowSpec) {
3434
if tr := spec.Processors[i].Core.TableReader; tr != nil {
3535
releaseTableReaderSpec(tr)
3636
}
37+
spec.Processors[i] = execinfrapb.ProcessorSpec{}
3738
}
3839
*spec = execinfrapb.FlowSpec{
3940
Processors: spec.Processors[:0],

0 commit comments

Comments
 (0)