Skip to content

Commit ce2d5d5

Browse files
danolivoarssher
authored andcommitted
Fix: bgwpool hold DSM segments after fault.
1 parent 1de5201 commit ce2d5d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bgwpool.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ BgwPoolStart(BgwPool* poolDesc, char *poolName, Oid db_id, Oid user_id)
4646

4747
/* ToDo: remember a segment creation failure (and NULL) case. */
4848
seg = dsm_create(size, 0);
49-
Assert(seg != NULL);
50-
dsm_pin_segment(seg);
49+
if (seg == NULL)
50+
ereport(FATAL,
51+
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
52+
errmsg("BgwPool can't create an DSM segment")));
5153

5254
poolDesc->dsmhandler = dsm_segment_handle(seg);
5355
queue = (char *) dsm_segment_address(seg);

0 commit comments

Comments
 (0)