From 93eac8826f38bc9799d7b810ee065c05afcc5151 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 23 Feb 2013 19:37:52 +0000 Subject: [PATCH] ProcManager: only log times_out_of_qworkers for new queries Logging times_out_of_qworkers in ProcessQueues is not accurate: recently-idle queryworkers may not be noticed and marked idle while ProcessQueues is looping and draining the @IdleQueryWorkers pool. Instead, only log times_out_of_qworkers when new requests are enqueued. --- lib/MogileFS/ProcManager.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/MogileFS/ProcManager.pm b/lib/MogileFS/ProcManager.pm index 25d8259..7b30365 100644 --- a/lib/MogileFS/ProcManager.pm +++ b/lib/MogileFS/ProcManager.pm @@ -415,6 +415,10 @@ sub EnqueueCommandRequest { ($client->peer_ip_string || '0.0.0.0') . " $line" ]; MogileFS::ProcManager->ProcessQueues; + if (@PendingQueries) { + # Don't like the name. Feel free to change if you find better. + $Stats{times_out_of_qworkers}++; + } } # puts a worker back in the queue, deleting any outstanding jobs in @@ -574,11 +578,6 @@ sub ProcessQueues { # 123-455 10.2.3.123 get_paths foo=bar&blah=bar\r\n $worker->write("$worker->{pid}-$worker->{reqid} $clref->[1]\r\n"); } - - if (@PendingQueries) { - # Don't like the name. Feel free to change if you find better. - $Stats{times_out_of_qworkers}++; - } } # send short descriptions of commands we support to the user -- 2.11.4.GIT