Github user srdo commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2764#discussion_r209045056
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
    @@ -1984,11 +2074,13 @@ private int fragmentedCpu() {
             Cluster cluster = new Cluster(inimbus, supervisors, 
topoToSchedAssignment, topologies, conf);
             cluster.setStatusMap(idToSchedStatus.get());
     
    -        long beforeSchedule = System.currentTimeMillis();
    +        schedulingStartTime.set(Time.nanoTime());
             scheduler.schedule(topologies, cluster);
    -        long scheduleTimeElapsedMs = System.currentTimeMillis() - 
beforeSchedule;
    -        LOG.debug("Scheduling took {} ms for {} topologies", 
scheduleTimeElapsedMs, topologies.getTopologies().size());
    -        scheduleTopologyTimeMs.update(scheduleTimeElapsedMs);
    +        //Will compiler optimize the order of evalutation and cause race 
condition?
    --- End diff --
    
    If we keep the update and race, I think we need to either remove the 
comments about the race, or expand them to provide the example you posted. 
Leaving the comment as is won't help someone reading it later understand what 
race is there.


---

Reply via email to