Bug 17750 - apt backend takes too long for some operations
Summary: apt backend takes too long for some operations
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: backend-apt (show other bugs)
Version: unspecified
Hardware: Other All
: medium major
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
: 19953 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-24 02:28 UTC by James Westby
Modified: 2009-07-04 12:24 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description James Westby 2008-09-24 02:28:46 UTC
Hi,

Using the apt backend you quite often get the error message

"The backend took too much time to process the synchronous request - you need to fork!"

which stops the operation. If you choose a long operation, e.g.
"all packages" in gpk-application and you get this error then
the gui is unusable for a couple of minutes as the "Package"
signals from your request are being emitted, so if you choose
a category then more packages are shown than what is in this
category.

One of my comments from the Ubuntu bug report:

"I can reproduce it reliably enough searching for a package in
gpk-application that I could investigate more.

Running the backend in debug mode shows that each time it is in
the

  DEBUG:Check apt cache and xapian database

phase when it gives the error.

Presumably this machine takes a little too long to open the databases,
leading to the error."

Originally reported at

  https://bugs.launchpad.net/bugs/272410

Thanks,

James
Comment 1 Khashayar Naderehvandi 2008-09-24 05:04:46 UTC
I can confirm seeing this issue. I'm willing to test patches if need be.
Comment 2 Richard Hughes 2008-09-24 09:53:02 UTC
The error "you need to fork" is a developer message to the backend authors. What is means is the DBUS method took too long to execute, and "blocked" the daemon from any other activity.

What's meant to happen is that the daemon "forks" the command into the background, where it can process more reuests in the meantime. If the backend spends over 500ms processing the command without releasing control of the daemon, then you get this message.

Do you get this message on every transaction, or only on certain types? Can you reproduce it 100% reliably, or only when somehting else happens?
Comment 3 James Westby 2008-09-24 16:02:55 UTC
> Do you get this message on every transaction, or only on certain types? Can you
> reproduce it 100% reliably, or only when something else happens?

It's not 100% reliable on a particular command, but some are more likely
to trigger it than others. Some trigger it the first run when things aren't
cached, but then won't once they are.

Thanks,

James

Comment 4 Sebastian Heinlein 2008-09-27 15:55:41 UTC
The backend now forces serialisation of nearly all calls (4bc7370cac1564fa3109d2a62df53d62a5cba176).

Could you please test the latest version from the PPA or git? If the package signal is still delayed into the next method it seems to be a dbus issue and not a thread race condition.

Cheers
Comment 5 James Westby 2008-10-06 04:19:00 UTC
Hi,

This is still present with 0.3.5 from the PPA.

Thanks,

James
Comment 6 Markus Thielmann 2009-02-09 18:54:26 UTC
The bug is still present in 0.3.14 on Ubuntu Jaunty. I'm able to reproduce it every time I run one of the tools.
Comment 7 Jonathan Thomas 2009-03-18 16:24:12 UTC
*** Bug 19953 has been marked as a duplicate of this bug. ***
Comment 8 James Westby 2009-07-04 12:24:38 UTC
Hi,

This is fixed now that apt is a spawned backend.

Thanks,

James


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.