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

Commit 70c0a65

Browse files
committed
catch config reload errors in MtmExecutor too
1 parent c465c30 commit 70c0a65

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/bgwpool.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ BgwPoolMainLoop(BgwPool* pool)
7373
pqsignal(SIGTERM, BgwShutdownHandler);
7474
pqsignal(SIGHUP, PostgresSigHupHandler);
7575

76+
// XXX: probably we should add static variable that signalizes that
77+
// we are between pool->active += 1 and pool->active -= 1, so if
78+
// we face an ERROR outside of PG_TRY we can decrement pool->active
79+
// from on_shem_exit_hook
80+
7681
BackgroundWorkerUnblockSignals();
7782
BackgroundWorkerInitializeConnectionByOid(pool->db_id, pool->user_id, 0);
7883
ActivePortal = &fakePortal;

src/pglogical_apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,7 @@ MtmExecutor(void* work, size_t size, MtmReceiverContext *receiver_ctx)
14731473
top_context = MemoryContextSwitchTo(MtmApplyContext);
14741474
replorigin_session_origin = InvalidRepOriginId;
14751475

1476+
PG_TRY();
14761477

14771478
AcceptInvalidationMessages();
14781479
if (!receiver_mtm_cfg_valid)
@@ -1494,7 +1495,6 @@ MtmExecutor(void* work, size_t size, MtmReceiverContext *receiver_ctx)
14941495
ResetAllOptions();
14951496
CommitTransactionCommand();
14961497

1497-
PG_TRY();
14981498
{
14991499
bool inside_transaction = true;
15001500
do {

0 commit comments

Comments
 (0)