Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6c878a7

Browse files
committed
Avoid server crash when worker registration fails at execution time.
The previous coding attempts to destroy the DSM in this case, but child nodes might have stored data there and still be holding onto pointers in this case. So don't do that. Also, free the reader array instead of leaking it. Extracted from two different patch versions both by Amit Kapila.
1 parent 74d0d5f commit 6c878a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/executor/nodeGather.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ ExecGather(GatherState *node)
190190

191191
/* No workers? Then never mind. */
192192
if (!got_any_worker)
193-
ExecShutdownGather(node);
193+
ExecShutdownGatherWorkers(node);
194194
}
195195

196196
/* Run plan locally if no workers or not single-copy. */
@@ -402,6 +402,8 @@ ExecShutdownGatherWorkers(GatherState *node)
402402

403403
for (i = 0; i < node->nreaders; ++i)
404404
DestroyTupleQueueReader(node->reader[i]);
405+
406+
pfree(node->reader);
405407
node->reader = NULL;
406408
}
407409

0 commit comments

Comments
 (0)