bipinprasad commented on a change in pull request #3212: [STORM-3587] Allow 
Scheduler futureTask to gracefully exit with higher timeout.
URL: https://github.com/apache/storm/pull/3212#discussion_r385505804
 
 

 ##########
 File path: 
storm-server/src/main/java/org/apache/storm/scheduler/resource/ResourceAwareScheduler.java
 ##########
 @@ -166,7 +166,7 @@ private void scheduleTopology(TopologyDetails td, Cluster 
cluster, final User to
                     Future<SchedulingResult> schedulingFuture = 
backgroundScheduling.submit(
                         () -> finalRasStrategy.schedule(toSchedule, td));
                     try {
-                        result = 
schedulingFuture.get(schedulingTimeoutSeconds, TimeUnit.SECONDS);
+                        result = schedulingFuture.get(schedulingTimeoutSeconds 
+ 1, TimeUnit.SECONDS);
 
 Review comment:
   I see your point. 
   
   When I think about cooperating process, is that the strategy is a time-bound 
task and part of the same code base running in the same JVM - so there never 
should be a a need to kill a FutureTask except as a precaution against bug 
introduced inadvertently.
   
   Current ConstraintSolver uses a different (but redundant) config variable 
for time limit - which is accidentally set to the same default value.
   
   In light of this - it may be better to explicitly pass "max" time limit to 
the constraint solver. And then determine how much the margin needs to be, and 
then add the margin to the FutureTask timeout. Note that this extra margin (and 
the timeout exception should only happen in exceptional  case when there is bug 
in ConstraintSolver. Normally it will/should exit by the timeout duration.
   And the result should be available.
    

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to