Uploaded image for project: 'mod-inventory-storage'
  1. mod-inventory-storage
  2. MODINVSTOR-1000

ItemStorageTest.canMoveItemToNewInstance ConditionTimeout/NPE



    • Bug
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • 25.0.0, 25.0.1
    • 25.0.2, 26.0.0
    • None
    • CP: Sprint 152, CP: Sprint 154
    • 1
    • Core: Platform
    • Nolana (R3 2022) Bug Fix
    • Implementation coding issue


      Data corruption in mod-search/Elasticsearch/OpenSearch because the item is correctly updated in mod-inventory-storage but not in mod-search/Elasticsearch/OpenSearch.

      About 20% of all builds in GitHub Action fail with this error:

        ItemStorageTest.canMoveItemToNewInstance:410 ยป ConditionTimeout Condition with...   

      The log of the failure has this exception during the canMoveItemToNewInstance test:

      18:28:27 [] [test_tenant] [] [mod_inventory_storage] ERROR ?                    Unhandled exception
      java.lang.NullPointerException: null
      	at org.folio.services.domainevent.ItemDomainEventPublisher.publishUpdated(ItemDomainEventPublisher.java:38) ~[classes/:?]
      	at org.folio.services.item.ItemService.lambda$14(ItemService.java:141) ~[classes/:?]

      NPE is caused by oldHoldings being null as there is no async coordination in the code – publishUpdated may execute (and actually executes in 20% of all runs) before the old holding has been fetched; oldHoldings is a parameter passed into publishUpdated.

      As a result the Kafka item event message with the item change is not generated and mod-search/Elasticsearch/OpenSearch is NOT updated and has still the old item record.

      The percentage (20%) of affected item moves may vary because it is a timing/race condition issue that likely depends on the deployment environment (hardware) and how other parallel processes use mod-inventory-storage and the database.

      After introducing async coordination this build failure no longer happens and the Kafka item event message is always sent.

      TestRail: Results


          Issue Links



                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                0 Vote for this issue
                1 Start watching this issue



                  TestRail: Runs

                    TestRail: Cases