Skip to content

Commit 163a4c4

Browse files
author
Sokolov Yura
committed
cfs.c: fix stop background worker on restart.
1 parent e46d274 commit 163a4c4

File tree

1 file changed

+2
-1
lines changed
  • src/backend/storage/file

1 file changed

+2
-1
lines changed

src/backend/storage/file/cfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,7 @@ static bool cfs_gc_directory(int worker_id, char const* path)
14081408
static void cfs_gc_cancel(int sig)
14091409
{
14101410
cfs_gc_stop = true;
1411+
SetLatch(MyLatch);
14111412
}
14121413

14131414
static void cfs_sighup(SIGNAL_ARGS)
@@ -1464,7 +1465,7 @@ static void cfs_gc_bgworker_main(Datum arg)
14641465
rc = WaitLatch(MyLatch,
14651466
WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH,
14661467
timeout /* ms */ );
1467-
if (rc & WL_POSTMASTER_DEATH)
1468+
if ((rc & WL_POSTMASTER_DEATH) || cfs_gc_stop)
14681469
exit(1);
14691470

14701471
ResetLatch(MyLatch);

0 commit comments

Comments
 (0)