Skip to content

Commit 344efe8

Browse files
Jian Guomy-ship-it
authored andcommitted
Call the query_info_collect_hook directly if expection happens
GPCC needs that hook, but don't call `mppExecutorCleanup()` since `queryDesc->estate` is NULL in that case.
1 parent d0ac915 commit 344efe8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/executor/execMain.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
238238
{
239239
PG_TRY();
240240
{
241-
switch(*gp_resmanager_memory_policy)
241+
switch (*gp_resmanager_memory_policy)
242242
{
243243
case RESMANAGER_MEMORY_POLICY_AUTO:
244244
PolicyAutoAssignOperatorMemoryKB(queryDesc->plannedstmt,
@@ -255,7 +255,10 @@ standard_ExecutorStart(QueryDesc *queryDesc, int eflags)
255255
}
256256
PG_CATCH();
257257
{
258-
mppExecutorCleanup(queryDesc);
258+
/* GPDB hook for collecting query info */
259+
if (query_info_collect_hook)
260+
(*query_info_collect_hook)(QueryCancelCleanup ? METRICS_QUERY_CANCELED : METRICS_QUERY_ERROR, queryDesc);
261+
259262
PG_RE_THROW();
260263
}
261264
PG_END_TRY();

0 commit comments

Comments
 (0)