mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-09-26 19:41:13 +08:00
chore!: uniformize thread attribute name in logs (#1699)
This commit is contained in:
@@ -56,7 +56,7 @@ func (thread *phpThread) boot() {
|
||||
|
||||
// start the actual posix thread - TODO: try this with go threads instead
|
||||
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")
|
||||
}
|
||||
|
||||
|
@@ -197,7 +197,7 @@ func deactivateThreads() {
|
||||
|
||||
// convert threads to inactive if they have been idle for too long
|
||||
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)
|
||||
stoppedThreadCount++
|
||||
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)
|
||||
// Reactivate this if there is a better solution or workaround
|
||||
// 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()
|
||||
// stoppedThreadCount++
|
||||
// autoScaledThreads = append(autoScaledThreads[:i], autoScaledThreads[i+1:]...)
|
||||
|
Reference in New Issue
Block a user