Skip to content

Commit 3e799bf

Browse files
committed
fix: fix queue depth metrics on timeout
1 parent 3bd2d20 commit 3e799bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

caddy/caddy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ func TestMaxWaitTimeWorker(t *testing.T) {
915915

916916
expectedMetrics := `
917917
# TYPE frankenphp_worker_queue_depth gauge
918-
frankenphp_worker_queue_depth{worker="service"} 9
918+
frankenphp_worker_queue_depth{worker="service"} 0
919919
`
920920

921921
ctx := caddy.ActiveContext()

worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (worker *worker) handleRequest(fc *frankenPHPContext) {
217217
case scaleChan <- fc:
218218
// the request has triggered scaling, continue to wait for a thread
219219
case <-timeoutChan(maxWaitTime):
220-
// metrics.DequeuedWorkerRequest(worker.name)
220+
metrics.DequeuedWorkerRequest(worker.name)
221221
// the request has timed out stalling
222222
fc.reject(504, "Gateway Timeout")
223223
return

0 commit comments

Comments
 (0)