-
Notifications
You must be signed in to change notification settings - Fork 294
Loading collector twice causes failure of task creation #1128
Comments
I was able to reproduce this on master so labeling as a bug. Haven't been able to identify the exact cause yet but looking into it. |
Nice catch @mkuculyma. This may be the best bug this quarter. |
Looking at it I think it's related to this line. A reference to the loaded plugin is added to the metric catalog before we verify if a plugin with a matching key is already loaded. For metrics it allows multiple writes with the same metrics, but for plugins it does not allow it so it happily overwrites the metrics in the catalog (and the plugin associated with them). The plugin it saves there ends up erroring because it is already loaded, and it's executable is removed. When the task is created we look at the metric catalog and gather the removed plugin's info from it, which gives the error: |
…ailure Proper copy of config policy Deep copy of node rules removed rules slice allocation and index
(SDI-1827): Fix #1128 Loading collector twice causes task failure
…ailure Proper copy of config policy Deep copy of node rules removed rules slice allocation and index
Description
The issue appears when one accidentally attempts to load already loaded collector plugin. Framework informs that plugin has been already loaded, but after that creating a task fails. snapd needs to be restarted and all the plugins loaded properly from the beginning in order to run a task. This is quite confusing as it seems that something is wrong with the collector.
Steps to reproduce this error:
snapd -l 1 -t 0
snapctl plugin load snap-plugin-collector-iostat/build/rootfs/snap-plugin-collector-iostat
snapctl plugin load snap-plugin-collector-iostat/build/rootfs/snap-plugin-collector-iostat
iostat.txt
Result
Task is created but does not collect metrics.
The text was updated successfully, but these errors were encountered: