Mailinglist Archive: opensuse-buildservice (170 mails)

< Previous Next >
Re: [opensuse-buildservice] /monitor page shows wrong info about workers
  • From: Adrian Schröter <adrian@xxxxxxx>
  • Date: Tue, 20 Mar 2012 09:22:36 +0100
  • Message-id: <32509246.DG0r5AATkt@scherben>
Am Montag, 19. März 2012, 10:01:32 schrieb Srinidhi B:
On 3/19/2012 at 08:58 PM, Adrian Schröter<adrian@xxxxxxx> wrote:
Am Montag, 19. März 2012, 17:19:40 schrieb Ed Bartosh:
Hi,

I added 2 new worker hosts and stopped obs-worker service on old host
several days ago. However, OBS web UI /monitor page still shows my old
host
and does not show two new ones. Builds are running just fine, which means
that obs server knows about new workers and uses them.

Any idea how to fix this? At least where to look in the code?

obsapidelayed job is not running/working.


Or if you're running memcached, restart it.

I found the same problem when I upgraded my local OBS instance from 2.0.5 to
2.3. The /monitor page would show that builds were running for more than 32+
hrs, whereas, on the backend, no real jobs were running -
/srv/obs/jobs/<arch>/ was empty.

I later found out that in
/srv/www/obs/api/app/controllers/status_controller.rb, "workerstatus" is
written to cache without any expiry timeout.

To solve this, in my local instance I changed the following code:

I think your problem is as well the not running delayed job. It feeds the cache,
so it is not necessary for the webui to do it. Which can create quite some load
if many
people do it in parallel.

bye
adrian

$ diff -u /tmp/status_controller.rb
/srv/www/obs/api/app/controllers/status_controller.rb
--- /tmp/status_controller.rb 2012-03-19 21:18:13.000000000 +0530
+++ /srv/www/obs/api/app/controllers/status_controller.rb 2012-01-18
07:13:33.000000000 +0530
@@ -126,7 +126,7 @@
data=REXML::Document.new(ret)

mytime = Time.now.to_i
- Rails.cache.write('workerstatus', ret)
+ Rails.cache.write('workerstatus', ret, :expires_in => 20.seconds)
data.root.each_element('blocked') do |e|
line = StatusHistory.new
line.time = mytime

Things have been better since this patch.

Hope this helps,
Srinidhi.

PS: there is one more Rails.cache.write in helpers/status_helper.rb without
any :expires_in field. I haven't changed it because I haven't seen any
problems so far with querying jobhistory.

--
Adrian Schroeter
SUSE Linux Products GmbH
email: adrian@xxxxxxx

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >