Skip to content

Commit 4216920

Browse files
mrdrivingduckpolardb-bot[bot]
authored andcommitted
fix: bgworker registration check
1 parent d52e825 commit 4216920

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/storage/ipc/polar_procpool.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,11 @@ polar_reg_sub_task(polar_task_sched_ctl_t *ctl, uint32 i)
10061006
StrNCpy(worker.bgw_type, ctl->sched->name, BGW_MAXLEN);
10071007
worker.bgw_main_arg = (Datum)(ctl->sched);
10081008

1009-
RegisterDynamicBackgroundWorker(&worker, &handle);
1010-
1011-
Assert(handle != NULL);
1009+
if (!RegisterDynamicBackgroundWorker(&worker, &handle))
1010+
ereport(PANIC,
1011+
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
1012+
errmsg("registering dynamic bgworker failed"),
1013+
errhint("Consider increasing configuration parameter \"max_worker_processes\".")));
10121014

10131015
ctl->sub_proc[i].handle = handle;
10141016
ctl->sub_proc[i].proc = NULL;

0 commit comments

Comments
 (0)