Skip to content

Commit 8e5af1e

Browse files
committed
physicalplan: harden PhysicalInfrastructure.Release
We sync-pool `PhysicalInfrastructure` objects and previously we wouldn't explicitly unset elements of `Processors` slice. This was done since it's a slice of values not pointers. However, those values themselves embed protobuf ProcessorSpec which contains more messages (among other things might have RenderExprs) which we do want to lose the references to, so this commit fixes that oversight. Release note: None
1 parent fd05c4c commit 8e5af1e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/sql/physicalplan/physical_plan.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ func NewPhysicalInfrastructure(
193193

194194
// Release resets the object and puts it back into the pool for reuse.
195195
func (p *PhysicalInfrastructure) Release() {
196-
// We only need to nil out the local processors since these are the only
197-
// pointer types.
196+
for i := range p.Processors {
197+
p.Processors[i] = Processor{}
198+
}
198199
for i := range p.LocalProcessors {
199200
p.LocalProcessors[i] = nil
200201
}

0 commit comments

Comments
 (0)