Skip to content

Commit f7b061d

Browse files
committed
Tell couchbase to reattach threads if needed, before preparing to fork
1 parent d25bbe7 commit f7b061d

File tree

1 file changed

+7
-0
lines changed
  • lib/Phpfastcache/Extensions/Drivers/Couchbasev4

1 file changed

+7
-0
lines changed

lib/Phpfastcache/Extensions/Drivers/Couchbasev4/Driver.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ public static function prepareToFork(): void
164164
}
165165

166166
if (\version_compare(static::$extVersion, '4.2.1', '>=')) {
167+
if (static::$prepareToForkPPID) {
168+
if (static::$prepareToForkPPID === \posix_getpid()) {
169+
Cluster::notifyFork(ForkEvent::PARENT);
170+
} else {
171+
Cluster::notifyFork(ForkEvent::CHILD);
172+
}
173+
}
167174
Cluster::notifyFork(ForkEvent::PREPARE);
168175
}
169176

0 commit comments

Comments
 (0)