Closed mgieseking closed 4 years ago
Currently it looks differently, since I at least get some feedback, that the job is canceled. But still the tab is never closed, but could there be a problem on the gui side @annyanich ?
A job failed with an exception. Stack track below.
java.util.concurrent.CancellationException
at java.base/java.util.concurrent.CompletableFuture.cancel(CompletableFuture.java:2468)
at uniolunisaar.adamwebfrontend.jobsystem.Job.cancel(Job.java:90)
at uniolunisaar.adamwebfrontend.App.handleCancelJob(App.java:419)
at uniolunisaar.adamwebfrontend.App.lambda$postWithUserContext$2(App.java:149)
at spark.RouteImpl$1.handle(RouteImpl.java:72)
at spark.http.matching.Routes.execute(Routes.java:61)
at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1671)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:505)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
at java.base/java.lang.Thread.run(Thread.java:832)
Garbage collection #5: 3999971 nodes / 9441 free / 0.457s / 1.196s total
Resizing node table from 3999971 to 7999921
Garbage collection #6: 7999921 nodes / 9441 free / 0.893s / 2.089s total
Resizing node table from 7999921 to 15999833
[ERROR] Calculation has been interrupted!
Calculation has been interrupted!
[uniolunisaar.adam.logic.synthesis.builder.twoplayergame.symbolic.bddapproach.BDDGraphAndGStrategyBuilder.builtGraph(BDDGraphAndGStrategyBuilder.java:108), uniolunisaar.adam.logic.synthesis.builder.twoplayergame.symbolic.bddapproach.BDDGraphAndGStrategyBuilder.builtGraph(BDDGraphAndGStrategyBuilder.java:47), uniolunisaar.adam.logic.synthesis.builder.twoplayergame.symbolic.bddapproach.BDDGraphAndGStrategyBuilder.builtGraph(BDDGraphAndGStrategyBuilder.java:37), uniolunisaar.adam.logic.synthesis.solver.symbolic.bddapproach.BDDSolver.calculateGraphGame(BDDSolver.java:531), uniolunisaar.adam.logic.synthesis.solver.symbolic.bddapproach.BDDSolver.getGraphGame(BDDSolver.java:538), uniolunisaar.adam.behavior.AdamSynthesisBDDBehavior.getGraphGame(AdamSynthesisBDDBehavior.java:458), uniolunisaar.adam.AdamSynthesizer.getGraphGameBDD(AdamSynthesizer.java:372), uniolunisaar.adamwebfrontend.jobsystem.JobType$6.lambda$makeJob$0(JobType.java:218), uniolunisaar.adamwebfrontend.jobsystem.Job.lambda$queue$0(Job.java:67), uniolunisaar.adamwebfrontend.jobsystem.Job.lambda$asFuture$2(Job.java:171), java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515), java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264), java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130), java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630), java.base/java.lang.Thread.run(Thread.java:832)]
Yes, it was a problem on the view layer, thanks for catching it :) (The server was not sending a notification to the client when the job finally finished cancelling.)
The job does still take a little while (maybe 15-30 seconds) to actually be canceled, but now, the tab closes as you would expect once the cancellation is finished.
I will push the commit as soon as I verify that #58 is also handled in my branch.
For example for the container example and generating the whole two-player game, canceling at least takes a very long time. Is it possible that the server is still in the native method calls of the BDD library and never returns such that I cannot cancel the thread or is there any other problem?