Skip to content

Commit

Permalink
fix: bgworker registration check
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdrivingduck authored and polardb-bot[bot] committed Apr 4, 2024
1 parent d52e825 commit 4216920
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/backend/storage/ipc/polar_procpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,9 +1006,11 @@ polar_reg_sub_task(polar_task_sched_ctl_t *ctl, uint32 i)
StrNCpy(worker.bgw_type, ctl->sched->name, BGW_MAXLEN);
worker.bgw_main_arg = (Datum)(ctl->sched);

RegisterDynamicBackgroundWorker(&worker, &handle);

Assert(handle != NULL);
if (!RegisterDynamicBackgroundWorker(&worker, &handle))
ereport(PANIC,
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
errmsg("registering dynamic bgworker failed"),
errhint("Consider increasing configuration parameter \"max_worker_processes\".")));

ctl->sub_proc[i].handle = handle;
ctl->sub_proc[i].proc = NULL;
Expand Down

0 comments on commit 4216920

Please sign in to comment.