Uploaded image for project: 'mod-data-export-worker'
  1. mod-data-export-worker
  2. MODEXPW-67

FolioExecutionContext is initialized with wrong tenant id if Spring Batch job launches asynchronously in multi tenant cluster

    XMLWordPrintable

Details

    • Firebird Sprint 132
    • 0
    • Firebird
    • Lotus R1 2022
    • Caltech, Middle Tennessee State University, Skidmore College, Texas Southmost College, University of Tennessee Martin, Washington College
    • TBD

    Description

      Overview:

      In multi tenant environment FolioExecutionContext is initialized with a new tenant id every time a new job is created from the different tenant. Sometimes, if job launches with async mode, FolioExecutionContext is initialized with tenant id other than id of the tenant this job comes from. It causes a try to update a job that does not exist in this tenant.

      Steps to Reproduce:

      1. Go to Circulation log and apply filter for Loan to have at least a couple of records (for example, Checked out).
      2. Create another tenant and do Step 1 under user from the new tenant.
      3. Go to Actions -> Export results (CSV).
      4. Repeat Step3 at least 20 times and wait for the completion of all jobs.
      5. Go to Export manager and you may see that a couple of jobs have SCHEDULED status.
      6. Retrieve logs for mod-data-export-spring and you may see ERROR mentioned in the Description of this bug.
      7. Retrieve logs for mod-data-export-worker and you may see the following ERROR:
      ERROR AbstractStep         Encountered an error executing step getCirculationLogPartStep in job CIRCULATION_LOG
      ...
      java.lang.IllegalArgumentException: count must be greater than zero
      

      Expected Results:

      No mentioned errors in the log, no jobs with SCHEDULED status in multi tenant cluster.

      Actual Results:

      Jobs are getting stuck with SCHEDULED status, errors in the log.

      Additional Information:

      This bug appears only in multi tenant environment and can be reproduced on testing as well.

      Interested parties:

      TestRail: Results

        Attachments

          1. all_jobs_successfull_diku.PNG
            all_jobs_successfull_diku.PNG
            187 kB
          2. create_new_tenant_at_testing_env.PNG
            create_new_tenant_at_testing_env.PNG
            49 kB
          3. creating_several_jobs_for_new_tenant.PNG
            creating_several_jobs_for_new_tenant.PNG
            58 kB
          4. export_success_after_creating_jobs_for_new_tenant.PNG
            export_success_after_creating_jobs_for_new_tenant.PNG
            168 kB
          5. export_success_after_new_tenant.PNG
            export_success_after_new_tenant.PNG
            172 kB
          6. export_success.PNG
            export_success.PNG
            177 kB
          7. mod-data-export-spring.log
            664 kB
          8. mod-data-export-worker.log
            1.13 MB
          9. new_admin_user.PNG
            new_admin_user.PNG
            57 kB
          10. no_scheduled_jobs.PNG
            no_scheduled_jobs.PNG
            71 kB
          11. scheduled_jobs_do_not_exist.PNG
            scheduled_jobs_do_not_exist.PNG
            73 kB

          Issue Links

            Activity

              People

                Oleksandr_Bozhko Oleksandr Bozhko
                Oleksandr_Bozhko Oleksandr Bozhko
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases