Bug 579001

Summary: Editing a repository time-outs
Product: [SUSE Appliance Toolkit] WebYaST Reporter: Jiri Srain <jsrain>
Component: RepositoriesAssignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Martin Vidner <mvidner>
Severity: Normal    
Priority: P2 - High CC: jdsn, kkaempf, lslezak
Version: SLE11 SP1 Beta4   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: debugging patch
Proposed patch

Description Jiri Srain 2010-02-11 08:53:07 UTC
Observed with Appliance build 1.1.3 in VMware player

When editing an existing repository, following error is issued:


  execution expired

/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/connection.rb:175:in `request'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/connection.rb:138:in `get'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/base.rb:658:in `find_single'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/base.rb:586:in `find'
/srv/www/yast/lib/proxy_loader.rb:56:in `load_proxy'
/srv/www/yast/vendor/plugins/software/app/controllers/repositories_controller.rb:25:in `show'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/srv/www/yast/lib/yast/rack/static_overlay.rb:47:in `call'
/srv/www/yast/lib/yast/rack/static_overlay.rb:47:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/fastcgi.rb:58:in `serve'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:103:in `process_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:153:in `with_signal_handler'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:101:in `process_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:78:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:77:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:77:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:76:in `catch'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:76:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:51:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:23:in `process!'
/srv/www/yast/public/dispatch.fcgi:24
Comment 1 Jiri Srain 2010-02-11 09:11:51 UTC
Note that after this bug occurres, whole WebYaST is somehow "flaky" - I cannot even display the control center.

Restart of webservice makes WebUI work again (without restart of webclient)
Comment 2 Jiri Srain 2010-02-11 09:47:00 UTC
Looks like a more generic problem - I just ran into it with system time running from git locally.
Comment 3 Ladislav Slezák 2010-02-11 14:46:25 UTC
OK, setting P2.

Are you able to reproduce it reliably? For me it seems to be very random...
Comment 4 Jiri Srain 2010-02-12 07:43:33 UTC
I could reproduce it with 1.1.3 and 1.1.4. With 1.1.5 I get a different error. However, even after hitting it, I still can use the rest of WebYaST. When re-entering the dialog, I get the problem again.

  #<RuntimeError: attempted adding second root element to document>
/usr/lib/ruby/1.8/rexml/document.rb:92:in `<<'
/usr/lib/ruby/1.8/rexml/element.rb:868:in `add'
/usr/lib/ruby/1.8/rexml/child.rb:21:in `initialize'
/usr/lib/ruby/1.8/rexml/parent.rb:13:in `initialize'
/usr/lib/ruby/1.8/rexml/element.rb:59:in `initialize'
/usr/lib/ruby/1.8/rexml/element.rb:866:in `new'
/usr/lib/ruby/1.8/rexml/element.rb:866:in `add'
/usr/lib/ruby/1.8/rexml/element.rb:297:in `add_element'
/usr/lib/ruby/1.8/rexml/document.rb:99:in `add_element'
/usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:33:in `parse'
/usr/lib/ruby/1.8/rexml/document.rb:227:in `build'
/usr/lib/ruby/1.8/rexml/document.rb:43:in `initialize'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini/rexml.rb:17:in `new'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini/rexml.rb:17:in `parse'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini.rb:12:in `__send__'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/xml_mini.rb:12:in `parse'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/hash/conversions.rb:164:in `from_xml'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/formats/xml_format.rb:19:in `decode'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/connection.rb:138:in `get'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/base.rb:658:in `find_single'
/usr/lib/ruby/gems/1.8/gems/activeresource-2.3.5/lib/active_resource/base.rb:586:in `find'
/srv/www/yast/lib/proxy_loader.rb:56:in `load_proxy'
/srv/www/yast/vendor/plugins/software/app/controllers/repositories_controller.rb:25:in `show'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/srv/www/yast/lib/yast/rack/static_overlay.rb:47:in `call'
/srv/www/yast/lib/yast/rack/static_overlay.rb:47:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/fastcgi.rb:58:in `serve'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:103:in `process_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:153:in `with_signal_handler'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:101:in `process_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:78:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:77:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:77:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:76:in `catch'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:76:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:51:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/fcgi_handler.rb:23:in `process!'
/srv/www/yast/public/dispatch.fcgi:24
...
attempted adding second root element to document
Line: 
Position: 
Last 80 unconsumed characters:
Comment 5 Ladislav Slezák 2010-02-12 09:33:56 UTC
To comment 4:
That's a different problem, see bnc#579039 (it just have been fixed).
Comment 6 Ladislav Slezák 2010-02-12 10:36:51 UTC
I have finally moved forward:

The rest service has stdout redirected to /dev/null (/proc/3086/fd -> /dev/null), so the debugging trick from 
http://eigenclass.org/hiki.rb?ruby+live+process+introspection
cannot be used.

However, using the steps described at
http://weblog.jamisbuck.org/2006/9/22/inspecting-a-live-ruby-process
I was able to get:
0x87c6b98:	 "/usr/lib/ruby/vendor_ruby/1.8/dbus/bus.rb:716:in `select'"

When I reproduced the problem locally I could use the first debugging trick and the result is:

	from /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:716:in `select'
	from /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:716:in `run'
	from /local/lslezak/GIT/Yast/rest-service/webservice/../plugins/software/lib/packagekit.rb:142:in `transact'
	from /local/lslezak/GIT/Yast/rest-service/webservice/../plugins/software/app/models/repository.rb:30:in `find'
	from /local/lslezak/GIT/Yast/rest-service/webservice/../plugins/software/app/controllers/repositories_controller.rb:13:in `index'
	from /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'
	from /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
	from /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'
	from /usr/lib64/ruby/gems/1.8/gems/actionpack-2.3.5/lib
[and so on ..., the rest is not important]

So it seems to freeze somewhere in ruby-dbus code.

Unfortunately Martin is still on vacation.

Klaus, any idea what might went wrong?
Comment 7 Klaus Kämpf 2010-02-12 11:04:34 UTC
Its apparently a (PackageKit?) timeout which is not properly handled.

  plugins/software/lib/packagekit.rb:142:in `transact'
starts a transaction (by sending a request do PackageKit via D-Bus)

  /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:716:in `run'
'run' listens on the D-Bus for result messages
Each message has a "signal" name, identifying the type of message
run dispatches these signals based on the on_signal information that was set up before

 /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:716:in `select'
thats a standard kernel select() call listening on network sockets.


The timeout can have two reasons

1. PackageKit does not send a reply
2. PackageKit does send a signal but there's no receiver set up

(There should be a "Finished" receiver set up, i.e.
      proxy.on_signal("Finished") {|u1,u2| dbusloop.quit }
 in rest-service/plugins/software/lib/packagekit.rb)
Comment 8 Klaus Kämpf 2010-02-12 11:09:32 UTC
Hmm, the 'Finished' signal is captured via self.dbusloop
Comment 9 Ladislav Slezák 2010-02-12 13:30:06 UTC
But the signal callback is not processed sometimes, I added some debugging messages (I'll attach a patch).

'dbus-monitor --system' output: 

signal sender=:1.124 -> dest=(null destination) serial=57 path=/766_beaadeed_data; interface=org.freedesktop.PackageKit.Transaction; member=RepoDetail
   string "http-download.opensuse.org-476132dc"
   string "openSUSE-11.2 Updates"
   boolean false
signal sender=:1.124 -> dest=(null destination) serial=58 path=/766_beaadeed_data; interface=org.freedesktop.PackageKit.Transaction; member=StatusChanged
   string "finished"
signal sender=:1.124 -> dest=(null destination) serial=59 path=/766_beaadeed_data; interface=org.freedesktop.PackageKit.Transaction; member=Finished
   string "success"
   uint32 38

The 'Finished' signal _was_ sent but it wasn't caught or the signal handler was not processed correctly.
Comment 10 Ladislav Slezák 2010-02-12 13:33:41 UTC
Created attachment 342194 [details]
debugging patch

The patch prints:

Finishing RepoDetail signal handler
RepoDetail signal received: devel:tools:building, devel:tools:building, false
reading file...
                done
Finishing RepoDetail signal handler
RepoDetail signal received: http-download.opensuse.org-476132dc, openSUSE-11.2 Updates, false
reading file...
                done
Finishing RepoDetail signal handler

and then it stops.
The last repository signal was caught, (see the previous comment), but the following Finished signal got lost.
Comment 11 Ladislav Slezák 2010-02-12 14:51:53 UTC
Um, it seems that ruby-dbus evaluates registered callbacks before dbusloop.run is entered. It calls Dbus introspection when installing signal handler and when it waits for the introspection result it receives and processes other siganl handlers.

--> #0 DBus::Connection.process(m#DBus::Message) 
       at line /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:532
    #1 DBus::Connection.send_sync(m#DBus::Message) 
       at line /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:492
    #2 AddMatch(arg0#String) at line (eval):22
    #3 DBus::Connection.add_match(mr#DBus::MatchRule) 
       at line /usr/lib64/ruby/vendor_ruby/1.8/dbus/bus.rb:512
    #4 DBus::ProxyObjectInterface.on_signal(bus#DBus::SystemBus, name#String) 
       at line /usr/lib64/ruby/vendor_ruby/1.8/dbus/introspect.rb:393
    #5 DBus::ProxyObject.[](name#String) 
       at line /usr/lib64/ruby/vendor_ruby/1.8/dbus/introspect.rb:458
    #6 PackageKit.dbusloop(proxy#DBus::ProxyObject) 
       at line /local/lslezak/GIT/Yast/rest-service/plugins/software/lib/packagekit.rb:33
    #7 PackageKit.transact(method#String, args#String, signal#String, bg_stat#NilClass,...) 
       at line /local/lslezak/GIT/Yast/rest-service/plugins/software/lib/packagekit.rb:148
    #8 Repository.find(what#Symbol) 
       at line /local/lslezak/GIT/Yast/rest-service/plugins/software/app/models/repository.rb:32

I have a single line patch which calls the introspection explicitly before registering signal handlers. But I don't know whether it is correct, 
the code is unbelievably complex (at least for me).

I'll attach the patch, please test it!
Comment 12 Ladislav Slezák 2010-02-12 14:53:24 UTC
Created attachment 342206 [details]
Proposed patch
Comment 13 Ladislav Slezák 2010-02-12 16:15:02 UTC
Ugh, the patch doesn't help, I created a simple loop which calls curl and it stopped after a while :-(
Comment 14 Ladislav Slezák 2010-02-15 09:14:30 UTC
I'm giving up, the ruby-dbus code is really complex, reassigning to Martin...
Comment 15 Jiri Srain 2010-02-15 11:45:20 UTC
I cannot reproduce this bug any more with Build 1.1.7.
Comment 16 Ladislav Slezák 2010-02-15 13:31:01 UTC
Um, I guess the problem is still there, it's a race condition which might occur only rarely.

Could you run something like 

  curl -u root -c cookie.txt http://localhost:4984/login

and then 

  while true; do curl -b cookie.txt http://localhost:4984/repositories.xml > repositories.xml;done

inside the appliance?

For me it freezes after 20-30 attempts (in build 1.1.4).

I'll try the latest build.
Comment 17 Ladislav Slezák 2010-02-15 13:56:31 UTC
*** Bug 579567 has been marked as a duplicate of this bug. ***
Comment 18 Jiri Srain 2010-02-15 14:11:44 UTC
@#16: Yes, I can confirm that.
Comment 19 Ladislav Slezák 2010-02-17 16:53:16 UTC
I'm looking at the code and I think I have a suspect in packagekit.rb.
I'm testing a new patch, let's see if it helps...
Comment 20 Ladislav Slezák 2010-02-17 17:47:42 UTC
Yes, the problem was that the dbusloop object was created _after_ calling PackageKit via DBus. Depending on the actual timing the PackageKit result could be received _before_ entering the dbus loop which then hangs because no expected signal is received later.

After the fix it survived more than 40 minutes of intensive testing described in comment #16.

It was quite obvious in the code but I found it after adding a dozen of debug log messages...


Fixed in webyast-software-ws-0.1.8
Comment 21 Klaus Kämpf 2010-02-17 18:28:26 UTC
Great, thanks !

I now opened bnc#580619 to (hopefully) detect such scenarios.
Comment 22 Martin Vidner 2010-02-22 15:58:41 UTC
(In reply to comment #20)
> Yes, the problem was that the dbusloop object was created _after_ calling
> PackageKit via DBus.

For the record, actually no. If that were the case, there would still be a race condition, only with a shorter trigger window. What was too late (as a result of a previous refactoring) was the on_signal (org.freedesktop.DBus.AddMatch). But the fix ends up being right.