Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Snap spawning multiple plugin processes #1454

Open
nanliu opened this issue Jan 5, 2017 · 2 comments
Open

Snap spawning multiple plugin processes #1454

nanliu opened this issue Jan 5, 2017 · 2 comments

Comments

@nanliu
Copy link
Contributor

nanliu commented Jan 5, 2017

When debugging #1448, we tried to suspend/resume process via kill -STOP & kill -CONT. This uncovered some issues with how we start plugin processes. After several heartbeat failures, if the plugin process is resumed, snap will terminate it, but spawn multiple plugin processes.

We should guard this by ensuring this block of code is not executed simultaneously by multiple plugin failure events:
https://github.com/intelsdi-x/snap/blob/master/control/runner.go#L246-L281

This can be done crudely by a mutex lock and defer unlock around that section of code.

@nanliu nanliu added the type/bug label Jan 5, 2017
@lynxbat
Copy link
Contributor

lynxbat commented Jan 5, 2017

I would recommend locks be used for start, restart, and stop. I would have read and write locks on this also. This will prevent issues with comparisons like https://github.com/intelsdi-x/snap/blob/master/control/runner.go#L247 being wrong while a write is in flight.

@lynxbat
Copy link
Contributor

lynxbat commented Jan 5, 2017

We should capture a repeatable test from #1448 discovery to replicate and prove this is fixed. I am sure we were. Just pointing out the obvious :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants