venkateshwaracholan commented on code in PR #1093:
URL: https://github.com/apache/yunikorn-core/pull/1093#discussion_r3425673537


##########
pkg/events/event_system.go:
##########
@@ -227,6 +227,15 @@ func (ec *EventSystemImpl) AddEvent(event *si.EventRecord) 
{
        }
 
        metrics.GetEventMetrics().IncEventsCreated()
+
+       ec.Lock()
+       defer ec.Unlock()
+
+       if ec.stopped || ec.channel == nil {
+               metrics.GetEventMetrics().IncEventsNotChanneled()
+               return
+       }

Review Comment:
   Thanks for the suggestion. Switched AddEvent() to use RLock/RUnlock and 
factored the state check into isStopped(). Re-ran the race tests and they pass.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to