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: Reset the goal #1678

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Sep 6, 2024

New D-Bus API to reset the goal.

Resolves: #1653

Changes:

3cd0a6e (Marek Blaha, 5 minutes ago)
dnfdaemon: D-Bus API to reset the goal

With this patch the user can re-use the session to resolve multiple
transactions without running them. The use case might be to check what
dependencies would be installed with given package.

d77231b (Marek Blaha, 17 hours ago)
dnfdaemon: Add reset_goal() method

The method resets the current goal and transaction, which is necessary for
scenarios where the user wants to reuse the D-Bus session to resolve or
execute multiple transactions.

5dbe16a (Marek Blaha, 17 hours ago)
goal: Add missing members to reset() method

The reset() method currently does not reset all Goal members. This patch
adds those that are missing.

@m-blaha
Copy link
Member Author

m-blaha commented Sep 11, 2024

I'm not totally sure about automatically resetting after the transaction is done. The transaction might still be needed for follow-up calls, like collecting RPM errors that happened during execution.
@mcrha Would it be OK for you to manually call the reset() method at some point after the transaction is done?

@mcrha
Copy link
Contributor

mcrha commented Sep 11, 2024

Aha, you are right. If the errors reported by Goal::get_transaction_problems_string() or Goal::get_transaction_problems() still require the failed transaction, then it's perfectly fine to have the reset() called manually.

In fact, I planned to call the reset() always before I start a transaction (not exactly before Goal::do_transaction() call), to make sure nothing is left from the previous calls/transactions.

@m-blaha m-blaha force-pushed the mblaha/daemon-multiple-transactions branch from 3cd0a6e to 489eb0f Compare September 11, 2024 08:44
@m-blaha m-blaha marked this pull request as ready for review September 11, 2024 08:46
@mcrha
Copy link
Contributor

mcrha commented Sep 18, 2024

I gave a quick test to the changes in the current form and it works as expected in my use case. I tried to install/uninstall packages with not shared and with shared session and both cases work fine, including when "simulating" a transaction to figure out needed size to download/install.

@jan-kolarik jan-kolarik self-assigned this Sep 20, 2024
@jan-kolarik
Copy link
Member

@m-blaha The tests should be passing after merging the #1711. Could you please rebase to check it?

The reset() method currently does not reset all Goal members. This patch
adds those that are missing.
The method resets the current goal and transaction, which is necessary
for scenarios where the user wants to reuse the D-Bus session to resolve
or execute multiple transactions.
With this patch the user can re-use the session to resolve multiple
transactions without running them. The use case might be to check what
dependencies would be installed with given package.
@m-blaha m-blaha force-pushed the mblaha/daemon-multiple-transactions branch from 489eb0f to 6dd2cb7 Compare September 25, 2024 07:54
@m-blaha
Copy link
Member Author

m-blaha commented Sep 25, 2024

@m-blaha The tests should be passing after merging the #1711. Could you please rebase to check it?

Sorry for the delay, I missed the message. Rebased.

@jan-kolarik jan-kolarik added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit f27f1d4 Sep 26, 2024
20 checks passed
@jan-kolarik jan-kolarik deleted the mblaha/daemon-multiple-transactions branch September 26, 2024 10:49
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: Session caching can be harmful
3 participants