Uploaded image for project: 'mod-orders'
  1. mod-orders
  2. MODORDERS-694

PendingToOpenEncumbranceStrategy is not thread-safe

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • 12.2.0, 12.2.1, 12.2.2, 12.2.3, 12.2.4, 12.2.5, 12.3.0, 12.3.2
    • 12.4.0
    • None
    • ACQ Sprint 139
    • 2
    • Thunderjet
    • Morning Glory (R2 2022)
    • Implementation coding issue

    Description

      Overview:
      The implementation for MODORDERS-528 introduced a bug with parallel processing in PendingToOpenEncumbranceStrategy, because it uses attributes in a singleton.

      Steps to Reproduce:
      Use the parallel-update-order-lines-different-orders test from the MODFISTO-260 integration tests PR.

      Expected Results:
      The test fails in a different way, like a randomly wrong budget at the end.

      Actual Results:
      This error occurs:
      {{org.folio.rest.core.exceptions.HttpException: {"errors":[{"message":"must not be null","type":"1","code":"-1","parameters":[

      {"key":"amount","value":"null"}

      ]},{"message":"must not be null","type":"1","code":"-1","parameters":[

      {"key":"fiscalYearId","value":"null"}

      ]},{"message":"must not be null","type":"1","code":"-1","parameters":[

      {"key":"currency","value":"null"}

      ]}]}}}

      Additional Information:
      The current implementation was designed for speed optimization. We could either change the bean scope to instantiate it for every call (but that is not the pattern we have used elsewhere), pass the encumbranceRelationsHolders in methods (but that would make the interfaces significantly more complex), or simply create the holders for validation and recreate them later (which would have a slight impact on performance when opening an order).

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Andrei_Makaranka Andrei Makaranka
                damieng Damien Guillaume
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases