Do initial cleanup only once in pg_init (#4213)

In postmasters execution of _PG_init, IsUnderPostmaster will be false and
we want to do the cleanup at that time only, otherwise there is a chance that
there will be parallel queries and we might do a cleanup for things that are
already in use.
pull/4209/head
SaitTalhaNisanci 2020-10-02 09:12:39 +03:00 committed by GitHub
parent 6a341b6ab8
commit 45bb0fb587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -301,8 +301,17 @@ _PG_init(void)
PGC_S_OVERRIDE);
}
/*
* In postmasters execution of _PG_init, IsUnderPostmaster will be false and
* we want to do the cleanup at that time only, otherwise there is a chance that
* there will be parallel queries and we might do a cleanup for things that are
* already in use. This is only needed in Windows.
*/
if (!IsUnderPostmaster)
{
DoInitialCleanup();
}
}
/*