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: API to reset the session.base instance #1757

Merged
merged 8 commits into from
Nov 12, 2024

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Oct 4, 2024

This allows dnf5daemon users to reset their session and re-use it for another transaction.

For: #1653

This interface was dropped.
- fix return code in case of error
- add full_nevra to expected resolve() output
It's currently used to prevent running Goal.do_transaction call multiple
times simultaneously.
This change allow us to easily re-create the session goal object in case
of the base reset.
For resetting the base held in the session we will need to execute this
part of initialization on two places. This patch prevents code
duplication.
This call will re-create libdnf5::Base instance stored in the session.
As a result, the goal and transaction are reset as well.
@m-blaha m-blaha marked this pull request as ready for review October 21, 2024 08:33
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.

Thanks for nicely separating the work into commits! BTW, it might be helpful to add a test case for resetting the session and running a new transaction afterward. What do you think?

dnf5daemon-server/services/goal/goal.cpp Show resolved Hide resolved
Since resolve() method re-sets transaction, use transaction mutex to
prevent running Goal.resolve() if another transaction is running.
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.

The unit test implementation is deferred to a separate issue as it's not easy and straightforward with the daemon testing...

@jan-kolarik jan-kolarik added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit 4ebad76 Nov 12, 2024
20 checks passed
@jan-kolarik jan-kolarik deleted the mblaha/daemon-reset-base branch November 12, 2024 12:22
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.

2 participants