Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancelling operations is allowed when allow_cancel is FALSE #209

Open
iainlane opened this issue Aug 5, 2017 · 4 comments
Open

Cancelling operations is allowed when allow_cancel is FALSE #209

iainlane opened this issue Aug 5, 2017 · 4 comments

Comments

@iainlane
Copy link
Contributor

iainlane commented Aug 5, 2017

This is related to this gnome-software bug.

I tried to reproduce it with packagekitd --verbose running, and got the following output on the terminal:

16:02:17	PackageKit          emitting allow-cancel 0
16:02:17	PackageKit          opened logind fd 42
16:02:17	PackageKit          1 transactions in list, 1 committed but not finished
PARENT process running...
16:02:19	PackageKit          emit package installing, libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, LLVM D Compiler - Phobos2 Standard library, shared objects
16:02:19	PackageKit          emitting item-progress libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, install: 0
16:02:19	PackageKit          emit package preparing, libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, LLVM D Compiler - Phobos2 Standard library, shared objects
16:02:19	PackageKit          emitting item-progress libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, setup: 25
16:02:19	PackageKit          emit package decompressing, libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, LLVM D Compiler - Phobos2 Standard library, shared objects
16:02:19	PackageKit          emitting item-progress libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, install: 50
16:02:19	PackageKit          emit package preparing, libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, LLVM D Compiler - Phobos2 Standard library, shared objects
16:02:19	PackageKit          emitting item-progress libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, setup: 75
16:02:19	PackageKit          emit package finished, libphobos2-ldc72;1:1.2.0-1;amd64;ubuntu-artful-universe, LLVM D Compiler - Phobos2 Standard library, shared objects
16:02:19	PackageKit          emit package installing, libgtkd-3-0;3.6.5-2ubuntu1;amd64;ubuntu-artful-universe, GTK+ graphical user interface library - D bindings
16:02:19	PackageKit          emitting item-progress libgtkd-3-0;3.6.5-2ubuntu1;amd64;ubuntu-artful-universe, install: 0
16:02:19	PackageKit          emit package preparing, libgtkd-3-0;3.6.5-2ubuntu1;amd64;ubuntu-artful-universe, GTK+ graphical user interface library - D bindings
16:02:19	PackageKit          emitting item-progress libgtkd-3-0;3.6.5-2ubuntu1;amd64;ubuntu-artful-universe, setup: 25
16:02:20	PackageKit          Cancel method called on /66_aecbccbd
16:02:20	PackageKit          same sender, no need to check uid
Parent finished...
16:02:20	PackageKit          emitting allow-cancel 1
16:02:20	PackageKit          closed logind fd 42
16:02:20	PackageKit          1 transactions in list, 1 committed but not finished
16:02:20	PackageKit          internal error: failed, but no error code: cancelled
16:02:20	PackageKit          backend was running for 4428 ms
16:02:20	PackageKit          emitting finished 'cancelled', 4428
16:02:20	PackageKit          internal error: failed, but no error code: cancelled
16:02:20	PackageKit          transaction now finished
16:02:20	PackageKit          1 transactions in list, 0 committed but not finished
16:02:25	PackageKit          transaction /66_aecbccbd completed, removing
16:02:25	PackageKit          emitting destroy /66_aecbccbd

So the backend said we couldn't cancel, yet when the cancellable was cancelled, we went ahead and stopped the operation anyway.

I think there's probably a UI bug in gnome-software too that it should have respected allow_cancel being set to FALSE and hid the button in that case.

@iainlane
Copy link
Contributor Author

iainlane commented Aug 5, 2017

@ximion

@dantti
Copy link
Collaborator

dantti commented Aug 5, 2017

@hughsie shouldn't the pk-backend method check allow_cancel before dispatching to the backend?

@hughsie
Copy link
Collaborator

hughsie commented Aug 5, 2017

That, and also the GNOME UI should have the correct button sensitivity set...

@dantti
Copy link
Collaborator

dantti commented Aug 5, 2017

Yup, otherwise, it would still be cancelable via DBus, I could fix aptcc but fixing in pk-backend means no other backend might get hit by this.. tho I'm not sure in a threaded backend this would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants