[Rpm-maint] Plugin findings
Panu Matilainen
pmatilai at laiskiainen.org
Thu Mar 28 10:31:45 UTC 2013
Hi,
There's really nothing like field-testing when it comes to finding
issues... Now that I simply have to run with the selinux plugin enabled
(otherwise I'd have a very broken system real fast), hacking on new
plugins revealed a some fairly nasty issues in the plugin system (and
caused a fair bit of head-scratching early in the morning :) that's gone
merrily unnoticed so far:
When there are more than one plugins present, an unsupported hook (or
errors like not finding the hook) in one plugin will cause all the
remaining plugins to be skipped on that hook. This is because
RPMPLUGINS_SET_HOOK_FUNC() does 'return <rc>' on several conditions,
which doesn't go very well with for-loops...
Another related thing is that RPMPLUGINS_SET_HOOK_FUNC() is executed
several times per each file in the transaction, times number of plugins
loaded. It didn't matter for the collection plugins as they are so
different in nature, but now with several hooks per each file its just
terribly wasteful if nothing else.
So... I'm planning on doing some fairly major surgery on the whole
thing. Just checking whether you have some work-in-progress in this
area, IIRC you were planning to look into changing the plugin
initialization (move it much earlier etc) and I dont want to clash with
that work if you've already started it.
FWIW the kind of thing I have in mind is make plugins into "objects"
that hold their own data (like name, symbol handle etc) and hooks are
function pointers in the struct that are initialized when the plugin is
first loaded so we dont have to rediscover the hook functions on each
and every round, etc.
- Panu -
More information about the Rpm-maint
mailing list