wilfred-s commented on a change in pull request #216:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/216#discussion_r567520478
##########
File path: pkg/scheduler/partition.go
##########
@@ -264,6 +264,8 @@ func (pc *PartitionContext) isStopped() bool {
func (pc *PartitionContext) handlePartitionEvent(event objects.ObjectEvent)
error {
err := pc.stateMachine.Event(event.String(), pc.Name)
if err == nil {
+ pc.Lock()
+ defer pc.Unlock()
Review comment:
For Time the [documentation](https://golang.org/pkg/time/#Time) shows:
> A Time value can be used by multiple goroutines simultaneously except that
the methods GobDecode, UnmarshalBinary, UnmarshalJSON and UnmarshalText are not
concurrency-safe.
Which would mean that we do not need a lock.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]