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

Commit a228256

Browse files
committed
Merge commit '81bfd7f793597a34a5b831e9345405c79223781e' into PGPRO10
2 parents a097839 + 81bfd7f commit a228256

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contrib/pg_pageprep/pg_pageprep.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,12 @@ start_bgworker_dynamic(const char *dbname, Oid relid, bool wait)
714714
elog(WARNING, "pg_pageprep (%s): WaitForBackgroundWorkerShutdown() failed", buf);
715715
}
716716

717+
/*
718+
* TODO: this is just a temporary workaround; should use latch to make
719+
* sure that child process has already attached to the segment.
720+
*/
721+
sleep_interruptible(5*1000);
722+
717723
/* Remove the segment */
718724
dsm_detach(seg);
719725

@@ -839,6 +845,8 @@ worker_main(Datum arg)
839845
CurrentResourceOwner = ResourceOwnerCreate(NULL, "pg_pageprep");
840846

841847
seg = dsm_attach((dsm_handle) DatumGetInt32(arg));
848+
if (!seg)
849+
elog(ERROR, "pg_pageprep: cannot attach to dynamic shared memory segment");
842850
worker_args = (WorkerArgs *) dsm_segment_address(seg);
843851

844852
/* keep the arguments */

0 commit comments

Comments
 (0)