Skip to content

Commit 291dd4e

Browse files
authored
chore!: uniformize thread attribute name in logs (#1699)
1 parent 30ef5f6 commit 291dd4e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

phpthread.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (thread *phpThread) boot() {
5656

5757
// start the actual posix thread - TODO: try this with go threads instead
5858
if !C.frankenphp_new_php_thread(C.uintptr_t(thread.threadIndex)) {
59-
logger.LogAttrs(context.Background(), slog.LevelError, "unable to create thread", slog.Int("threadIndex", thread.threadIndex))
59+
logger.LogAttrs(context.Background(), slog.LevelError, "unable to create thread", slog.Int("thread", thread.threadIndex))
6060
panic("unable to create thread")
6161
}
6262

scaling.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func deactivateThreads() {
197197

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

0 commit comments

Comments
 (0)