From 3de691a4df443ebd6cd90b46a4d98d741846ff21 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 18 Aug 2022 11:39:14 -0700 Subject: [PATCH] events: fix race in acl event handling (#14188) --- nomad/stream/event_broker.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nomad/stream/event_broker.go b/nomad/stream/event_broker.go index e619968e0..da5f8f0ab 100644 --- a/nomad/stream/event_broker.go +++ b/nomad/stream/event_broker.go @@ -43,7 +43,7 @@ type EventBroker struct { aclDelegate ACLDelegate aclCache *lru.TwoQueueCache - aclCh chan *structs.Event + aclCh chan structs.Event logger hclog.Logger } @@ -72,7 +72,7 @@ func NewEventBroker(ctx context.Context, aclDelegate ACLDelegate, cfg EventBroke logger: cfg.Logger.Named("event_broker"), eventBuf: buffer, publishCh: make(chan *structs.Events, 64), - aclCh: make(chan *structs.Event, 10), + aclCh: make(chan structs.Event, 10), aclDelegate: aclDelegate, aclCache: aclCache, subscriptions: &subscriptions{ @@ -101,7 +101,7 @@ func (e *EventBroker) Publish(events *structs.Events) { // updated ACL Token or Policy for _, event := range events.Events { if event.Topic == structs.TopicACLToken || event.Topic == structs.TopicACLPolicy { - e.aclCh <- &event + e.aclCh <- event } }