Skip to content

Commit 218af7b

Browse files
committed
fix: fix queue depth metrics on timeout
1 parent a8eaa04 commit 218af7b

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
@@ -1023,7 +1023,7 @@ func TestMaxWaitTimeWorker(t *testing.T) {
10231023

10241024
expectedMetrics := `
10251025
# TYPE frankenphp_worker_queue_depth gauge
1026-
frankenphp_worker_queue_depth{worker="service"} 9
1026+
frankenphp_worker_queue_depth{worker="service"} 0
10271027
`
10281028

10291029
ctx := caddy.ActiveContext()

worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func (worker *worker) handleRequest(fc *frankenPHPContext) {
225225
case scaleChan <- fc:
226226
// the request has triggered scaling, continue to wait for a thread
227227
case <-timeoutChan(maxWaitTime):
228-
// metrics.DequeuedWorkerRequest(worker.name)
228+
metrics.DequeuedWorkerRequest(worker.name)
229229
// the request has timed out stalling
230230
fc.reject(504, "Gateway Timeout")
231231
return

0 commit comments

Comments
 (0)