-
Notifications
You must be signed in to change notification settings - Fork 294
Plugin clean-up in case of task stop #711
Comments
@andrzej-k: I think this is achieved today with the sticky routing/caching strategy #539 #670. Would you agree? |
Well, to me it seems that sticky routing helps greatly, since plugin instance (for example: the one with opened DB connection) will be used consistently. But still in case of stopping the task, the plugin will just receive SIGKILL, and won't be able to do any actions based on this (like closing DB connection). One solution to this, proposed by @danielscottt, was to change SIGKILL to other, catch-able signal and then handle that signal on the plugin side. The other solution could be to extend client-side Plugin interface (implemented by plugins) to include also Kill() or Cleanup() func (in addition to GetConfigPolicy()) which could be called by framework once plugin is to be killed - but that would probably require re-work of all existing plugins. |
We are facing issues with
As of now we are going to use systemd to launch Contact me if you want to get more detailed description. |
@andrzej-k, GRPC lib-go provides such capability to kill/ping between servers(plugins) and the Snap GRPC client. Probably we can think along this line to connecting task killing,... @IRCody is working on a related bug fix currently. I think all these interactions will have to consider the implication @andrzej-k mentioned. |
@candysmurf - I am aware of implications that @andrzej-k mentioned and I do not expect collector interface to be extended before 1.0. Would there be a chance to sent another signal, prior to |
@candysmurf - #1192 won't help, I'm afraid. It seems to affect collecting, processing and publishing but not actual plugin killing. As far as I understand logic in |
@candysmurf - isn't this comment clear enough? #711 (comment) |
@iwankgb, As it mixed with @andrzej-k's, I think they're not exact the same. Do you like to pull your comment into a new issue? |
Let's assume that collector plugin retrieves metrics from the database, and in order to do that it needs to establish connection to the database. Instead of opening and closing DB connection within CollectMetrics() during each interval, it opens connection to DB once and then re-uses it.
Now user decides to stop task which is using aforementioned plugin, this will result in DB connection not being closed.
Maybe we need a method on a plugin side to do clean-up in such cases?
The text was updated successfully, but these errors were encountered: