Commit Graph

9 Commits

Author SHA1 Message Date
Steve Winslow 8ca1f66a2d Fixed typo in license statement URL
Signed-off-by: Steve Winslow <swinslow@gmail.com>
2018-12-02 08:12:09 -05:00
stuart nelson e883ccb9de
pull out shared code for storing alerts (#1507)
Move the code for storing and GC'ing alerts from being re-implemented in
several packages to existing in its own package

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-09-03 14:52:53 +02:00
Max Leonard Inden 1219541184
*.go: Introduce errcheck enforcing error handling
Errcheck [1] enforces error handling accross all go files. Functions can
be excluded via `scripts/errcheck_excludes.txt`.

This patch adds errcheck to the `test` Make target.

[1] https://github.com/kisielk/errcheck

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-08-30 15:47:13 +02:00
Sergiusz Urbaniak f9896e0162
provider/mem: cleanup closed listener in GC
... rather than in the Subscribe method. Currently the cleanup for a
given Alert subscription is done in a blocking goroutine, started in
the Subscribe method.

This simplifies it by moving the cleanup to the GC.

Additionally it simplifies the subscribe method by setting up the
buffered channel big enough to fill it up with all pending alerts
preventing the necessity to start a goroutine in Subscribe at all.

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>
2018-08-13 09:35:11 +02:00
Max Inden d4788ed195 provider/mem: Add `Put` `Subscribe` starvation test (#1503)
TestAlertsSubscribePutStarvation tests starvation of `iterator.Close` and
`alerts.Put`. Both `Subscribe` and `Put` use the Alerts.mtx lock. `Subscribe`
needs it to subscribe and more importantly unsubscribe `Alerts.listeners`.
`Put` uses the lock to add additional alerts and iterate the `Alerts.listeners`
map.  If the channel of a listener is at its limit, `alerts.Lock` is blocked,
whereby a listener can not unsubscribe as the lock is hold by `alerts.Lock`.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-08-06 16:00:17 +02:00
wangYue 0fc0ff8e71 Avoid listener blocking (#1482)
Signed-off-by: wangyue <wangyue@actiontech.com>
2018-08-06 13:24:21 +02:00
stuart nelson 481eab7b83 Make alertGC interval configurable 2017-12-19 15:36:38 +01:00
stuart nelson 6a909abf17 Add processing status field to alert 2017-04-27 14:18:52 +02:00
Fabian Reinartz 6a20296af4 *: fixup, remove bolt provider 2016-08-09 14:17:50 +02:00