pbacsko commented on code in PR #840:
URL: https://github.com/apache/yunikorn-core/pull/840#discussion_r1561396780
##########
pkg/scheduler/partition.go:
##########
@@ -591,14 +590,12 @@ func (pc *PartitionContext) updatePartitionResource(delta
*resources.Resource) {
// This locks the partition. The partition may not be locked when we process
the allocation
// additions to the node as that takes further app, queue or node locks
func (pc *PartitionContext) addNodeToList(node *objects.Node) error {
- pc.Lock()
- defer pc.Unlock()
- // Node can be added to the system to allow processing of the
allocations
if err := pc.nodes.AddNode(node); err != nil {
return fmt.Errorf("failed to add node %s to partition %s,
error: %v", node.NodeID, pc.Name, err)
}
+ pc.Lock()
+ defer pc.Unlock()
Review Comment:
It's possible, however, we'd like to be consistent. If we decide not to grab
the PartitionContext lock in other cases, it's better to do the same here,
becase we avoid locks that are overlapping.
--
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]