Pressing ctrl-c after the download starts in the following program hangs perform() approximately once every five attempts on my machine: #! /usr/bin/python import librepo import urlgrabber def cb(*args): print args if __name__ == "__main__": h = librepo.Handle() h.interruptible = True h.repotype = librepo.LR_YUMREPO h.setopt(librepo.LRO_MIRRORLIST, 'https://mirrors.fedoraproject.org/metalink?repo=fedora-17&arch=x86_64') h.progresscb = cb h.yumdlist = ["primary", "filelists", "prestodelta"] r = librepo.Result() h.perform(r) Stracing repeatedly shows: poll([{fd=24, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout) Strangely, this doesn't reproduce on my machine when a baseurl is used instead of the mirror list (could just be a heisenbug symptom). I consider this a rather critical problem with the interruptible implementation.
Hi, I am unable to reproduce the problem :-/ I've done some refactoring: https://github.com/Tojaj/librepo/commit/b92c99da67a0d26bfc250e5d8aac399cb793c6c0 <- This could fix the problem. Could you try the current git version of librepo and check if the problem still persists?
I can't reproduce it from internal redhat machine but at home I'm reproducing it quite reliably, even with the latest c55a8d5 checkout.
Still cannot reproduce the bug . What version of libcurl are you using? Could you try current git version of librepo + latest libcurl from fedora stable repositories (latest versions of libcurl in repositories support the CURL_GLOBAL_ACK_EINTR flag).
Created attachment 731694 [details] debug output Tried again, git checkout 03e0293, libcurl-7.24.0-6.fc17.x86_64. I built librepo with debug output this time, got a hang, attaching what I got hope it's interesting. the strace is still the same: poll([{fd=22, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout) poll([{fd=22, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout) poll([{fd=22, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout) poll([{fd=22, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout) poll([{fd=22, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 0 (Timeout) FWIW, my current script is below (removed the urlgrabber, for reference and against doubts): #! /usr/bin/python import librepo def cb(*args): print args if __name__ == "__main__": h = librepo.Handle() h.interruptible = True h.repotype = librepo.LR_YUMREPO h.setopt(librepo.LRO_MIRRORLIST, 'https://mirrors.fedoraproject.org/metalink?repo=fedora-17&arch=x86_64') h.progresscb = cb h.yumdlist = ["primary", "filelists", "prestodelta"] r = librepo.Result() h.perform(r)
It seems to stuck when cleanup curl handles. It's weird. I've added debug messages and change order of freeing of curl handles. Please try it again with debug output enabled (as you did last time) cmake -DCMAKE_BUILD_TYPE="DEBUG". Thank you
(In reply to comment #5) > It seems to stuck when cleanup curl handles. It's weird. I've added debug > messages and change order of freeing of curl handles. Please try it again > with debug output enabled (as you did last time) cmake > -DCMAKE_BUILD_TYPE="DEBUG". Thank you With 720d68d I can no longer reproduce this (tried 20 times). So the order of freeing the handles probably played a role. Thanks!
librepo-0.0.2-3.20130408git720d68d.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/librepo-0.0.2-3.20130408git720d68d.fc19
librepo-0.0.2-3.20130408git720d68d.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.