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

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: