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

Plugins not loaded after first daemon access #36

Open
LaurieReeves opened this issue Sep 4, 2020 · 0 comments
Open

Plugins not loaded after first daemon access #36

LaurieReeves opened this issue Sep 4, 2020 · 0 comments

Comments

@LaurieReeves
Copy link

Well, this is embarrassing.

There is a small issue with the recent pull-request that I submitted (ec3cbde) (which was merged, thank you!).

The first time the daemon is accessed everything works. Plugins are loaded, variables in repo urls are populated, everything's good. If the daemon is accessed a second time, plugins are not loaded, variables are not substituted. When I enable debug logging, I can see that the plugins fail to load: "Failed to init plugins: load_plugins() called twice".

In dnfdaemon, the dnf.Base object is "reset" after a transaction and it looks like that is not compatible with plugins. However, I do see that the reset is necessary to get updated state. e.g. if you install a package the current dnf.Base thinks the package is not installed.

As per the dnf documentation, it is assumed that the dnf.Base object lives for the length of the program's life and there is further implication that plugins get a reference to this Base object:

https://dnf.readthedocs.io/en/latest/api_base.html

For now, I can force the daemon to exit before every transaction, but this is not ideal. I fear a more formal solution would require a bit of a refactoring, but hopefully there's a simple fix.

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

1 participant