Skip to content

Commit 3f43199

Browse files
fix: removes opcache_hook again (#2564)
This PR removes the opcache invalidate hook again. Possible issue in #2553. A hard restart everytime the opcache resets due to memory overflow sounds like a good idea at first, but if a framework relies on a lot of opcache invalidation, restarts might become recursive.
1 parent ca919b9 commit 3f43199

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

frankenphp.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,14 +1003,9 @@ PHP_FUNCTION(frankenphp_log) {
10031003
}
10041004
}
10051005

1006-
static void frankenphp_opcache_restart_hook(int reason) {
1007-
(void)reason;
1008-
go_schedule_opcache_reset(frankenphp_thread_index());
1009-
}
1010-
10111006
/* {{{ thread-safe opcache reset */
10121007
PHP_FUNCTION(frankenphp_opcache_reset) {
1013-
frankenphp_opcache_restart_hook(0);
1008+
go_schedule_opcache_reset(frankenphp_thread_index());
10141009

10151010
RETVAL_TRUE;
10161011
} /* }}} */
@@ -1705,13 +1700,6 @@ static void *php_main(void *arg) {
17051700

17061701
frankenphp_sapi_module.startup(&frankenphp_sapi_module);
17071702

1708-
#if defined(ZTS) && PHP_VERSION_ID >= 80400
1709-
/* Also restart everything on opcache memory overflow or similar events, the
1710-
* hook is triggered right before an opcache reset is scheduled
1711-
*/
1712-
zend_accel_schedule_restart_hook = frankenphp_opcache_restart_hook;
1713-
#endif
1714-
17151703
/* check if a default filter is set in php.ini and only filter if
17161704
* it is, this is deprecated and will be removed in PHP 9 */
17171705
char *default_filter;

0 commit comments

Comments
 (0)