Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2742

JVM never quits when using SolverManager with moveThreadCount AUTO after exception thrown in a move

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.24.0.Final
    • 8.23.0.Final
    • optaplanner-core
    • None
    • NEW
    • NEW

      When creating a simple SolverManager-based job:

      try (SolverManager<..., UUID> manager = SolverManager.create(...)) {
          SolverJob<..., UUID> job = manager.solve(UUID.randomUUID(), inputSolution);
          ... solution = job.getFinalBestSolution();
      }
      

      I get a JVM that never terminates. The following conditions must be met in order for the bug to reproduce consistently:

      • MoveThreadCount > 0; multi-threaded solving must be enabled.
      • An exception is thrown from within a move.

      If either condition is not met, the JVM will terminate properly.
      When both conditions are met and the JVM hangs, the thread dump has the following properties:

      • It does not contain the main thread.
      • It shows OptaPool-3-MoveThread-1 stuck at at org.optaplanner.core.impl.heuristic.thread.MoveThreadRunner.run(MoveThreadRunner.java:80)

      From this, I assume that the parallel solver fails to clean up its executors in case of abnormal termination.

              rsynek@redhat.com Radovan Synek (Inactive)
              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: