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

daemon: D-Bus API to cancel current transaction #1665

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Aug 30, 2024

Resolves: #1660

Changes:

41f5a93 (Marek Blaha, 38 minutes ago)
dnfdaemon: API to cancel running Goal.do_transaction()

During the download phase, calling Goal.cancel() will cause all downloads
to abort and transaction will not be performed. Once the rpm transaction is
started, the cancel is not any more allowed and rpm transaction will
finish.

b8e03b2 (Marek Blaha, 39 minutes ago)
DownloadCallbacks: Enum for possible return codes

Instead of hard coded constants use enum as callbacks return values.

Instead of hard coded constants use enum as callbacks return values.
@m-blaha m-blaha force-pushed the mblaha/daemon-cancel-download branch from 41f5a93 to 274f7cb Compare August 30, 2024 11:30
New API `Goal.cancel()` cancels the transaction that was initiated by
`do_transaction()`. The transaction can only be canceled during the
package download phase. Once the RPM transaction has begun, cancellation
is no longer permitted.
@m-blaha m-blaha force-pushed the mblaha/daemon-cancel-download branch from 274f7cb to aec787f Compare August 30, 2024 11:44
@jan-kolarik jan-kolarik self-assigned this Sep 4, 2024
Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The workflow for the entire cancel operation is clearly understood from the code. Thanks!

@jan-kolarik jan-kolarik added this pull request to the merge queue Sep 4, 2024
Merged via the queue into main with commit 4926fc5 Sep 4, 2024
11 of 20 checks passed
@jan-kolarik jan-kolarik deleted the mblaha/daemon-cancel-download branch September 4, 2024 14:13
-->
<method name="cancel">
<arg name="success" type="b" />
<arg name="error_msg" type="s" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set direction="out" for both of these, please. The default, when not set, is the arguments are input arguments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #1679 for this (the change is part of it)

mcrha added a commit to mcrha/dnf5 that referenced this pull request Sep 6, 2024
…::cancel method

Both the arguments are output arguments, to be read by client, not
to be set by the client, thus mark them as such.

Related to rpm-software-management#1665 (comment)
mcrha added a commit to mcrha/dnf5 that referenced this pull request Sep 6, 2024
…::cancel method

Both the arguments are output arguments, to be read by client, not
to be set by the client, thus mark them as such.

Related to rpm-software-management#1665 (comment)
github-merge-queue bot pushed a commit that referenced this pull request Sep 6, 2024
…::cancel method

Both the arguments are output arguments, to be read by client, not
to be set by the client, thus mark them as such.

Related to #1665 (comment)
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

Successfully merging this pull request may close these issues.

dnf5daemon-server: Add D-Bus API to cancel ongoing transaction
3 participants