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

CME when multiple threads call ScoreManager.updateScore()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.27.0.Final
    • None
    • None
    • None

      ScoreDirectors created from the same SolverFactory share a SolutionDescriptor instance, which builds a map of member accessors (generatedMemberAccessorMap).
      Thus, the same LinkedHashMap is being accessed (both for reading and writing) by multiple threads.
      The generatedMemberAccessorMap is referred to from many places and even created outside the SolutionDescriptor.

      Proposals:
      A) Make SolutionDescriptor immutable; at least in respect of the generatedMemberAccessorMap, which would be fully initialized before its first use.
      B) Create a wrapper around the generatedMemberAccessorMap instance and lock it with a ReadWrite lock.

              rsynek@redhat.com Radovan Synek (Inactive)
              rsynek@redhat.com Radovan Synek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: