Bug 442232 - yum doesn't try other mirrors after hitting ctrnl-c
yum doesn't try other mirrors after hitting ctrnl-c
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-12 21:58 EDT by Cassio
Modified: 2014-01-21 18:02 EST (History)
6 users (show)

See Also:
Fixed In Version: 3.2.16-2.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-28 22:37:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Cassio 2008-04-12 21:58:48 EDT
Description of problem:
yum does not try the next mirror when cntrl-c is pressed during the download of
a rpm.

Version-Release number of selected component (if applicable):
3.2.8

How reproducible:
Always

Steps to Reproduce:
1. yum install somepackage
2. while downloading hit cntrl-c
  
Actual results:
yum says trying another mirror but quits.

Expected results:
yum should try the next mirror and continue download.

Additional info:

example of my fedora.repo:

[fedora]
name=Fedora $releasever - $basearch
failovermethod=roundrobin
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
enabled=1
retries=20
timeout=10
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
file:///etc/pki/rpm-gpg/RPM-GPG-KEY
Comment 1 Jack Deslippe 2008-04-15 16:58:45 EDT
I can confirm this bug for yum-3.2.8-2.fc8 and also in yum from rawhide.  
Comment 2 James Antill 2008-04-21 20:02:07 EDT
 This fixes it upstream, so I _assume_ rpm has done something recent-ishly.
Florian, can you take a look?

diff --git a/yum/__init__.py b/yum/__init__.py
index efee839..6a5a20d 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1074,6 +1074,8 @@ class YumBase(depsolve.Depsolve):
             if (self.conf.cache or repo_cached) and errors:
                 return errors
                 
+        import signal
+        signal.signal(signal.SIGINT, signal.default_int_handler)
 
         remote_pkgs.sort(mediasort)
         #  This is kind of a hack and does nothing in non-Fedora versions,


 The best part of debugging it is the signal.getsignal(signal.SIGINT) caches the
result ... assuming noone will set it behind python's back.
Comment 3 James Antill 2008-04-21 20:10:17 EDT
 It's probably worth noting that I tried self.closeRpmDB() instead, and that
didn't do anything.
Comment 4 James Antill 2008-04-22 19:15:47 EDT
 Ok, so I tried downgrading rpm to:

rpm.x86_64                               4.4.2.2-3.fc8          installed       
rpm-build.x86_64                         4.4.2.2-3.fc8          installed       
rpm-devel.i386                           4.4.2.2-3.fc8          installed       
rpm-devel.x86_64                         4.4.2.2-3.fc8          installed       
rpm-libs.x86_64                          4.4.2.2-3.fc8          installed       
rpm-libs.i386                            4.4.2.2-3.fc8          installed       
rpm-python.x86_64                        4.4.2.2-3.fc8          installed       

...which should be the Fed-8 GA version of rpm/rpm-libs/etc. but it still has
the same problem, so I'm guessing we changed something so that rpm sees the
C-c's now?
 This might also explain bug#240138
Comment 5 James Antill 2008-04-22 19:17:30 EDT
 FYI, bug#240138 is that basically the same thing happens in RHEL-5.2 using 3.2.8-*
Comment 6 James Antill 2008-04-23 00:39:34 EDT
 Ok, so adding some trace code to rpm/rpmio/rpmsq.c:rpmsqEnable() I see:

y Loaded plugins
r rpm takes SIGINT    = ref 1
r rpm releases SIGINT = ref 0
y <pkgSack>
y <Excluding Packages> etc.
[...]
y Setting up Upgrade Process
r rpm takes SIGINT    = ref 1
y Resolving Dependencies
[...]
y --> Finished Dependency Resolution
r rpm takes SIGINT    = ref 2
y --> Running transaction check
[...]
y Transaction Summary
r rpm releases SIGINT = ref 1
y Total size:
[...]

...and then the download happens.
Comment 7 James Antill 2008-04-23 01:13:21 EDT
 So ignoring the first ref/unref.

 The first  ref is from self.rpmdb.ts

 The second ref is from self.ts and then ts.dbMatch() in
misc.get_running_kernel_version_release().

 Committing a fix upstream to combine them, and delete it before the download
happens.
Comment 8 Fedora Update System 2008-05-16 15:05:53 EDT
yum-3.2.16-1.fc9 has been submitted as an update for Fedora 9
Comment 9 Fedora Update System 2008-05-18 11:17:00 EDT
yum-3.2.16-2.fc9 has been submitted as an update for Fedora 9
Comment 10 Fedora Update System 2008-05-28 22:37:05 EDT
yum-3.2.16-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.