From ffd353b1aa96e5330621581063ba8b9be8985b46 Mon Sep 17 00:00:00 2001 From: JianXian Date: Thu, 3 Sep 2020 17:45:29 +0800 Subject: [PATCH] fix bug bgworkers not exit of front error --- src/gausskernel/process/tcop/postgres.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 5c4711948..40a37dec8 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -6626,13 +6626,6 @@ int StreamMain(void* arg) int curTryCounter; int* oldTryCounter = NULL; if (sigsetjmp(local_sigjmp_buf, 1) != 0) { - if (t_thrd.msqueue_cxt.is_changed == true) { - pq_stop_redirect_to_shm_mq(); - } - if (t_thrd.autonomous_cxt.handle) { - TerminateBackgroundWorker(t_thrd.autonomous_cxt.handle); - t_thrd.autonomous_cxt.handle = NULL; - } gstrace_tryblock_exit(true, oldTryCounter); (void)pgstat_report_waitstatus(STATE_WAIT_UNDEFINED); @@ -7407,6 +7400,13 @@ int PostgresMain(int argc, char* argv[], const char* dbname, const char* usernam int curTryCounter; int* oldTryCounter = NULL; if (sigsetjmp(local_sigjmp_buf, 1) != 0) { + if (t_thrd.msqueue_cxt.is_changed == true) { + pq_stop_redirect_to_shm_mq(); + } + if (t_thrd.autonomous_cxt.handle) { + TerminateBackgroundWorker(t_thrd.autonomous_cxt.handle); + t_thrd.autonomous_cxt.handle = NULL; + } gstrace_tryblock_exit(true, oldTryCounter); u_sess->SPI_cxt.is_stp = true;