|
Bugzilla – Full Text Bug Listing |
| Summary: | DBUS communication hangs with PackageKit | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.2 | Reporter: | Stefan Schubert <schubi> |
| Component: | WebYaST | Assignee: | Martin Vidner <mvidner> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Blocker | ||
| Priority: | P2 - High | CC: | kkaempf |
| Version: | Factory | Flags: | coolo:
SHIP_STOPPER-
|
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: | ruby-dbus-debug.diff | ||
|
Description
Stefan Schubert
2009-09-08 13:26:48 UTC
From looking at the code, it seems as if a dbus daemon is started (main.loop). Shouldn't this be done in a separate Ruby thread ? > Shouldn't this be done in a separate Ruby thread ? No: "Make it clear in the documentation that one should not call DBus from multiple threads" https://trac.luon.net/ruby-dbus/ticket/22 Schubi, I don't know the PK API, but aren't you supposed to install all patches in a single transaction? That does not solve the bug, but would work around it. Its about retrieving a list of pending patches (i.e the /patches.xml REST path) I'm about to refactor the app/models/ code to make it testable and DRY. I have checked my old code before refactoring and this works:
obj_tid.on_signal("Package") do |line1,line2,line3|
columns = line2.split ";"
update = Patch.new(:resolvable_id => columns[1],
:kind => line1,
:name => columns[0],
:arch => columns[2],
:repo => columns[3],
:summary => line3 )
patch_updates << update
finished = true
end
obj_tid.on_signal("Error") do |u1,u2|
finished = true
end
obj_tid.on_signal("Finished") do |u1,u2|
finished = true
end
obj_tid_with_iface.GetUpdates("NONE")
unless finished
@main = MainPkg.new
@main << system_bus
@main.run
end
Have a look to the finished flag. While the second call, the result is very fast (without using libzypp) and the process does not go into mainloop. That works. So the signal comes although the process has not gone into the mainloop.
I do not know who is caching here.
I think I have the bug: DBus::Connection has a message buffer, but DBus::Main does not check if it contains anything and goes to sleep on the socket right away. Stay tuned for a fix. Fixed in http://github.com/mvidner/ruby-dbus/commit/2fca326bd857f528ff6ccb4bea7d8f9f8c98c7aa Now it works for me. Please just copy over the changed file, I will make an RPM when I add a test. Yes, it works. Thank you !!! Created attachment 317415 [details]
ruby-dbus-debug.diff
This is just a verbose debugging patch that does not fit in the library, so I keep it here.
Fixed in YaST:Web ruby-dbus 0.2.10. |