Skip to content

Commit acf2a1c

Browse files
committed
Test with grace period (again)
1 parent 8e87d00 commit acf2a1c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

caddy/caddy_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,6 @@ func TestOpcacheReset(t *testing.T) {
14891489
num_threads 40
14901490
php_ini {
14911491
opcache.enable 1
1492-
zend_extension opcache.so
14931492
opcache.log_verbosity_level 4
14941493
}
14951494
}

frankenphp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,15 +1268,15 @@ int frankenphp_execute_script_cli(char *script, int argc, char **argv,
12681268
}
12691269

12701270
int frankenphp_reset_opcache(void) {
1271-
php_request_startup();
12721271
zend_function *opcache_reset =
12731272
zend_hash_str_find_ptr(CG(function_table), ZEND_STRL("opcache_reset"));
12741273
if (opcache_reset) {
1274+
php_request_startup();
12751275
((zend_internal_function *)opcache_reset)->handler = orig_opcache_reset;
12761276
zend_call_known_function(opcache_reset, NULL, NULL, NULL, 0, NULL, NULL);
12771277
((zend_internal_function *)opcache_reset)->handler = ZEND_FN(frankenphp_opcache_reset);
1278+
php_request_shutdown((void *)0);
12781279
}
1279-
php_request_shutdown((void *)0);
12801280

12811281
return 0;
12821282
}

frankenphp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ func scheduleOpcacheReset(thread *phpThread) {
798798

799799
globalLogger.Info("resetting opcache in all threads")
800800
C.frankenphp_reset_opcache()
801+
time.Sleep(200 * time.Millisecond) // opcache_reset grace period
801802

802803
// all threads should have restarted now
803804
restartCounter.Store(0)

0 commit comments

Comments
 (0)