Database controller should not lock in PushUpdate

This commit is contained in:
Patrick Pacher 2020-10-07 08:57:18 +02:00
parent 643d67aff4
commit 33dcc88dc0
No known key found for this signature in database
GPG key ID: E8CD2DA160925A6D

View file

@ -195,6 +195,8 @@ func (c *Controller) Query(q *query.Query, local, internal bool) (*iterator.Iter
}
// PushUpdate pushes a record update to subscribers.
// The caller must hold the record's lock when calling
// PushUpdate.
func (c *Controller) PushUpdate(r record.Record) {
if c != nil {
c.exclusiveAccess.RLock()
@ -205,9 +207,7 @@ func (c *Controller) PushUpdate(r record.Record) {
}
for _, sub := range c.subscriptions {
r.Lock()
push := r.Meta().CheckPermission(sub.local, sub.internal) && sub.q.Matches(r)
r.Unlock()
if push {
select {