chore!: uniformize thread attribute name in logs (#1699)

This commit is contained in:
Kévin Dunglas
2025-06-29 09:33:06 +02:00
committed by GitHub
parent 30ef5f6657
commit 291dd4eed9
2 changed files with 3 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ func (thread *phpThread) boot() {
// start the actual posix thread - TODO: try this with go threads instead // start the actual posix thread - TODO: try this with go threads instead
if !C.frankenphp_new_php_thread(C.uintptr_t(thread.threadIndex)) { if !C.frankenphp_new_php_thread(C.uintptr_t(thread.threadIndex)) {
logger.LogAttrs(context.Background(), slog.LevelError, "unable to create thread", slog.Int("threadIndex", thread.threadIndex)) logger.LogAttrs(context.Background(), slog.LevelError, "unable to create thread", slog.Int("thread", thread.threadIndex))
panic("unable to create thread") panic("unable to create thread")
} }

View File

@@ -197,7 +197,7 @@ func deactivateThreads() {
// convert threads to inactive if they have been idle for too long // convert threads to inactive if they have been idle for too long
if thread.state.is(stateReady) && waitTime > maxThreadIdleTime.Milliseconds() { if thread.state.is(stateReady) && waitTime > maxThreadIdleTime.Milliseconds() {
logger.LogAttrs(context.Background(), slog.LevelDebug, "auto-converting thread to inactive", slog.Int("threadIndex", thread.threadIndex)) logger.LogAttrs(context.Background(), slog.LevelDebug, "auto-converting thread to inactive", slog.Int("thread", thread.threadIndex))
convertToInactiveThread(thread) convertToInactiveThread(thread)
stoppedThreadCount++ stoppedThreadCount++
autoScaledThreads = append(autoScaledThreads[:i], autoScaledThreads[i+1:]...) autoScaledThreads = append(autoScaledThreads[:i], autoScaledThreads[i+1:]...)
@@ -209,7 +209,7 @@ func deactivateThreads() {
// Some PECL extensions like #1296 will prevent threads from fully stopping (they leak memory) // Some PECL extensions like #1296 will prevent threads from fully stopping (they leak memory)
// Reactivate this if there is a better solution or workaround // Reactivate this if there is a better solution or workaround
// if thread.state.is(stateInactive) && waitTime > maxThreadIdleTime.Milliseconds() { // if thread.state.is(stateInactive) && waitTime > maxThreadIdleTime.Milliseconds() {
// logger.LogAttrs(nil, slog.LevelDebug, "auto-stopping thread", slog.Int("threadIndex", thread.threadIndex)) // logger.LogAttrs(nil, slog.LevelDebug, "auto-stopping thread", slog.Int("thread", thread.threadIndex))
// thread.shutdown() // thread.shutdown()
// stoppedThreadCount++ // stoppedThreadCount++
// autoScaledThreads = append(autoScaledThreads[:i], autoScaledThreads[i+1:]...) // autoScaledThreads = append(autoScaledThreads[:i], autoScaledThreads[i+1:]...)