-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daemon Mode Bug fixed #89
Conversation
@@ -183,12 +183,10 @@ public final void solve(Solution planningProblem) { | |||
public void outerSolvingStarted(DefaultSolverScope solverScope) { | |||
solving.set(true); | |||
basicPlumbingTermination.resetTerminateEarly(); | |||
solverScope.setStartingSystemTimeMillis(System.currentTimeMillis()); | |||
solverScope.setEndingSystemTimeMillis(null); | |||
solverScope.setStartingSolverCount(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startingSolverCount should only reset in the outerSolving, because it is used to determine if a solver is "started" or "restarted", see DefaultSolver#solvingStarted().
Thanks for the PR. I am merging & reviewing & fixing now, will take a while I think, because there is a deeper problem. |
@@ -183,12 +183,10 @@ public final void solve(Solution planningProblem) { | |||
public void outerSolvingStarted(DefaultSolverScope solverScope) { | |||
solving.set(true); | |||
basicPlumbingTermination.resetTerminateEarly(); | |||
solverScope.setStartingSystemTimeMillis(System.currentTimeMillis()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that resets are needed, for time terminations, for timegradient, etc.
But don't we need to track the outerStarting time too, for some functionality? Investigating now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the startingSovlerCount should be placed in the outerSolverStarted. Agreed that the outerSolverStarting time could be useful. Because in multi-tenance application, each daemon mode solver will hog up a cpu core and therefore is resource consuming (more $$ charging for tenants). Some tenants may want to kill the always-on solver after the operation hours (e.g. 9am to 9pm for a vehicle routing application). Then the optaplanner execution server cluster can serve more customers with less cpu cores with the help of a job dispatching layer. The outerSolvingTime can be used to indicate how long the "solving application" has been running and the solver can stop restarting the solver in daemon once the time termination config has been met. private boolean checkProblemFactChanges(){ if (termination.isDaemonModeTerminated(System.currentTimeMillis - outerSolverStaringTime){ return false; }…..…..}private boolean checkProblemFactChanges() { Original Message Sender: Geoffrey De Smetnotifications@github.comRecipient: droolsjbpm/optaplanneroptaplanner@noreply.github.comCc: isaaczhangadventurer18821688@qq.comDate: Tuesday, Jun 2, 2015 17:41Subject: Re: [optaplanner] Daemon Mode Bug fixed (#89)In optaplanner-core/src/main/java/org/optaplanner/core/impl/solver/DefaultSolver.java:
@@ -183,12 +183,10 @@ public final void solve(Solution planningProblem) {
public void outerSolvingStarted(DefaultSolverScope solverScope) {
solving.set(true);
basicPlumbingTermination.resetTerminateEarly();
solverScope.setStartingSystemTimeMillis(System.currentTimeMillis());
Agreed that resets are need, for time terminations, for timegradient, etc.
But don't we need to track the outerStarting time too, for some functionality? Investigating now.
—Reply to this email directly or view it on GitHub.
This also affects the average score count reported in the log. I am going to make that only account the ACC of the last solver start-end cycle. In 6.2.0.Final it reported a too low ACC of the entire solver run if the daemon mode was blocking (well too low for all practical interpretation use anyway). |
The good news:
The bad news:
Keep the PR's coming :) |
Great!Users are advised to run a long term solving running a turtle test that walks through the whole life cycle of their customized solver though ( building a solver, get it running till it waits in daemon mode, calls all the problemFactChange interface defined by the applications).In my limited experience, it is especially necesary to run such a long term test if the user have created some complicated moveFactoryIterator, filters and problemfactChange interfaces. Original Message Sender: Geoffrey De Smetnotifications@github.comRecipient: droolsjbpm/optaplanneroptaplanner@noreply.github.comCc: isaaczhangadventurer18821688@qq.comDate: Tuesday, Jun 2, 2015 23:40Subject: Re: [optaplanner] Daemon Mode Bug fixed (#89)The good news: It's fixed for 6.3.0.Beta1 along with a few other improvements related to real-time planning I tried your test locally and it works. Thanks for sending this PR with the unit test, as it made it clear what the exact problem was and what was your desired behaviour :) The bad news: I didn't merge your PR, but used it an inspiration. Keep the PR's coming :) —Reply to this email directly or view it on GitHub. |
The solverScope time parameters do not reset when solver starts again after a time termination.
It is fixed now. See the changes in the CloudBalancingDaemon Test.
Detailed description can be found here.
https://groups.google.com/forum/#!topic/optaplanner-dev/Rj1d2rGXa_k