MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecParallelCleanup

Function ExecParallelCleanup

src/backend/executor/execParallel.c:1180–1210  ·  view source on GitHub ↗

* Accumulate instrumentation, and then clean up whatever ParallelExecutorInfo * resources still exist after ExecParallelFinish. We separate these * routines because someone might want to examine the contents of the DSM * after ExecParallelFinish and before calling this routine. */

Source from the content-addressed store, hash-verified

1178 * after ExecParallelFinish and before calling this routine.
1179 */
1180void
1181ExecParallelCleanup(ParallelExecutorInfo *pei)
1182{
1183 /* Accumulate instrumentation, if any. */
1184 if (pei->instrumentation)
1185 ExecParallelRetrieveInstrumentation(pei->planstate,
1186 pei->instrumentation);
1187
1188 /* Accumulate JIT instrumentation, if any. */
1189 if (pei->jit_instrumentation)
1190 ExecParallelRetrieveJitInstrumentation(pei->planstate,
1191 pei->jit_instrumentation);
1192
1193 /* Free any serialized parameters. */
1194 if (DsaPointerIsValid(pei->param_exec))
1195 {
1196 dsa_free(pei->area, pei->param_exec);
1197 pei->param_exec = InvalidDsaPointer;
1198 }
1199 if (pei->area != NULL)
1200 {
1201 dsa_detach(pei->area);
1202 pei->area = NULL;
1203 }
1204 if (pei->pcxt != NULL)
1205 {
1206 DestroyParallelContext(pei->pcxt);
1207 pei->pcxt = NULL;
1208 }
1209 pfree(pei);
1210}
1211
1212/*
1213 * Create a DestReceiver to write tuples we produce to the shm_mq designated

Callers 2

ExecShutdownGatherMergeFunction · 0.85
ExecShutdownGatherFunction · 0.85

Calls 6

dsa_freeFunction · 0.85
dsa_detachFunction · 0.85
DestroyParallelContextFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected