Skip to content

Commit 66702fe

Browse files
committed
try not resetting opcache?
1 parent 22c6ba6 commit 66702fe

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

frankenphp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ HashTable *main_thread_env = NULL;
8686
__thread uintptr_t thread_index;
8787
__thread bool is_worker_thread = false;
8888
__thread HashTable *sandboxed_env = NULL;
89-
__thread zval *os_environment = NULL;
9089
zif_handler orig_opcache_reset;
9190

9291
/* Forward declaration */

frankenphp.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -777,16 +777,19 @@ func restartThreadsAndOpcacheReset(withRegularThreads bool) {
777777

778778
threadsToRestart := drainThreads(withRegularThreads)
779779

780-
opcacheResetOnce = sync.Once{}
781-
opcacheResetWg := sync.WaitGroup{}
782-
for _, thread := range threadsToRestart {
783-
thread.state.Set(state.OpcacheResetting)
784-
opcacheResetWg.Go(func() {
785-
thread.state.WaitFor(state.OpcacheResettingDone)
786-
})
787-
}
780+
// on 8.2 debian it segfaults, skip opcache reset
781+
if Version().VersionID >= 80300 {
782+
opcacheResetOnce = sync.Once{}
783+
opcacheResetWg := sync.WaitGroup{}
784+
for _, thread := range threadsToRestart {
785+
thread.state.Set(state.OpcacheResetting)
786+
opcacheResetWg.Go(func() {
787+
thread.state.WaitFor(state.OpcacheResettingDone)
788+
})
789+
}
788790

789-
opcacheResetWg.Wait()
791+
opcacheResetWg.Wait()
792+
}
790793

791794
for _, thread := range threadsToRestart {
792795
thread.drainChan = make(chan struct{})

0 commit comments

Comments
 (0)