Bug 30284 - Cannot cancel a download for the second time (and a weird error on the first cancel)
Summary: Cannot cancel a download for the second time (and a weird error on the first ...
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-20 09:28 UTC by Hedayat Vatankhah
Modified: 2010-09-21 03:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
packagekitd log for this session (86.12 KB, application/octet-stream)
2010-09-20 09:28 UTC, Hedayat Vatankhah
Details

Description Hedayat Vatankhah 2010-09-20 09:28:11 UTC
Created attachment 38826 [details]
packagekitd log for this session

I select eclipse-demos package to be installed. When the package is being downloaded, I press Cancel. The operation is canceled and this error is shown (which is a bit weird):

An internal system error has occured:
A problem that we were not expecting has occurred. Please report this bug in your distribution bugtracker with the error description.

More details: 
The backend exited unexpectedly. This is a serious error as the spawned backend did not complete the pending transaction.

Anyway, the more important problem is this one: After the error message, I press apply again so packagekit starts installing the selected package again. Again, when the package is being downloaded I press the Cancel button. This time, nothing happens and the download is being continued. Even if I close gpk-application, the daemon is still active and locking the yum repository.

The corresponding packagekitd log is attached. The daemon is stopped a little after pressing cancel button again and again in the last part. If I understood correctly, the daemon don't notice anything, so probably the problem is in the GUI application (But I'm not 100% sure).
Comment 1 Richard Hughes 2010-09-21 03:27:18 UTC
(In reply to comment #0)
> The backend exited unexpectedly. This is a serious error as the spawned backend
> did not complete the pending transaction.

commit 2b3c13110a448ab1535716c0944e43a7e945ac98
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Sep 21 11:06:58 2010 +0100

    Ensure we set an error if the spawned backend gets cancelled
    
    We can't assume the spawned backend gets a chance to set an error when we SIGQUIT it
    and so set a generic transaction cancelled error code when before we send the signal.
    
    This means we don't trigger the obnoxious internal error when sometimes cancelling
    tranasctions, e.g. '...This is a serious error as the spawned backend did not...' and
    we don't scare the user when there's nothing actually wrong.

> Anyway, the more important problem is this one: After the error message, I
> press apply again so packagekit starts installing the selected package again.
> Again, when the package is being downloaded I press the Cancel button. This
> time, nothing happens and the download is being continued. Even if I close
> gpk-application, the daemon is still active and locking the yum repository.

commit 05aa3f19090c1488071f79a4f6e16f4b20863ee8
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Sep 21 11:25:23 2010 +0100

    glib: Check the GCancellable is not already cancelled at startup in PkClient and PkControl

:100644 100644 d30bd28... 93d13d7... M  lib/packagekit-glib2/pk-client.c
:100644 100644 4dddc1c... 11f648c... M  lib/packagekit-glib2/pk-control.c
:100644 100644 07c31c4... 08fd7f3... M  lib/packagekit-glib2/pk-self-test.c

I've also applied this to gnome-packagekit:

commit c19881d387fb3abbac6469458d13af2c55f56ab2
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Sep 21 11:02:47 2010 +0100

    Ensure we reset the GCancellable before doing each async method
    
    If the user clicks the cancel button, then the cancellable gets set to cancelled state
    and the transaction returns. If the user then clicks it again for another transaction
    then nothing happens as we are already in the cancelled state.
    
    libpackagekit-glib in git master is already patched to address this, and will return
    an error if the method is called with a valid cancellable that is already in the
    cancel state.
Comment 2 Hedayat Vatankhah 2010-09-21 03:38:21 UTC
Thanks


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.