Ethanlm commented on a change in pull request #3136: [STORM-3519] Change ConstraintSolverStrategy::backtrackSearch to iteration URL: https://github.com/apache/storm/pull/3136#discussion_r334296660 ########## File path: storm-server/src/main/java/org/apache/storm/scheduler/resource/strategies/scheduling/ConstraintSolverStrategy.java ########## @@ -320,51 +320,101 @@ private boolean checkSchedulingFeasibility(int maxStateSearch) { return GenericResourceAwareStrategy.sortObjectResourcesImpl(allResources, exec, topologyDetails, existingScheduleFunc); } - // Backtracking algorithm does not take into account the ordering of executors in worker to reduce traversal space + /** + * Try to schedule till successful or till limits (backtrack count or time) have been exceeded. + * + * @param state terminal state of the executor assignment. + * @return SolverResult with success attribute set to true or false indicting whether ALL executors were assigned. + */ @VisibleForTesting protected SolverResult backtrackSearch(SearcherState state) { - state.incStatesSearched(); - if (state.areSearchLimitsExceeded()) { - LOG.warn("Limits Exceeded"); - return new SolverResult(state, false); - } + long startTimeMilli = System.currentTimeMillis(); Review comment: Do we want to use `Time.currentTimeMillis()` since we are using it in places like this https://github.com/apache/storm/blob/master/storm-server/src/main/java/org/apache/storm/scheduler/resource/strategies/scheduling/ConstraintSolverStrategy.java#L514 ---------------------------------------------------------------- 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: users@infra.apache.org With regards, Apache Git Services