Mailinglist Archive: zypp-devel (21 mails)

< Previous Next >
[zypp-devel] zypper miscounting when DownloadInAdvance used
  • From: Jano Kupec <jkupec@xxxxxxx>
  • Date: Fri, 06 Nov 2009 14:15:52 +0100
  • Message-id: <4AF42188.9040701@xxxxxxx>
Hi there!

When you switch on DownloadInAdvance, the DownloadResolvableReport is
still call, even if the package is already in cache. This causes this
callback is called twice for each package, and zypper has no good way of
counting the so-far-downloaded packages.

I see no easy way of avoiding this for 11.2. The information that the
package is available in cache is buried deep in the call stack in
Fetcher::Impl:

target::TargetImpl::commit(with PackageCache)
target::CommitPackageCache::get
target::CommitPackageCache::sourceProvidePackage
TargetImpl::RepoProvidePackage::operator()
DownloadResolvableReport sent from here -.
repo::PackageProvider::providePackage <-----------'
repo::PackageProvider::doProvidePackage
repo::Impl::RepoMediaAccess::provideFile
Fetcher::start
Fetcher::Impl::start
Fetcher::Impl::provideToDest
Fetcher::Impl::provideFromCache

The way i see it, we'll need to add bool Fetcher::isCached public method
and improve repo::PackageProvider to be able to use Fetcher::isCached
before it calls any callback (well, in fact, it should report
DownloadResolvableReport::gotFromCache). Maybe add bool
repo::PackageProvider::provideFromCache and only use the current code
flow if this returns false.

Or (maybe even better) we should completely avoid calling
repo::PackageProvider and get the files from cache in somewhat more
direct way (e.g. by remembering the paths of files already provided by
previous calls to PackageProvider during the download phase), if possible.

Any ideas?

(BTW, in the meantime i'll fix zypper by blindly resetting the counter
when it reaches the expected number of packages to download.)

https://bugzilla.novell.com/show_bug.cgi?id=545295

--
cheers,
jano


Ján Kupec
YaST team
---------------------------------------------------------(PGP)---
Key ID: 637EE901
Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901
---------------------------------------------------------(IRC)---
Server: irc.freenode.net
Nick: jniq
Channels: #zypp #yast #suse #susecz
---------------------------------------------------------(EOF)---

< Previous Next >
List Navigation
Follow Ups