Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31099

Manually scheduled tasks triggered after migration to Postgres

    Details

      Description

      Issue: Manually scheduled tasks triggered after migration to Postgres (on first startup of Nexus after migration Postgres).

      One example is the below task script tasks which is scheduled for manual and should not be triggered:

      2022-02-02 01:17:28,246+0000 INFO  [quartz-33-thread-17] prdxnex01 *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'purge test artifacts' [script] state change WAITING -> RUNNING
      

      Audit log shows that it was triggered by Nexus

      {"timestamp":"2022-02-02 01:17:26,399+0000","nodeId":"89A12B29-99F5DEC5-96169981-1999838B-98D8B764","initiator":"*TASK","domain":"tasks","type":"started","context":"Execute script","thread":"quartz-33-thread-6","attributes":{"schedule":"Manual{properties={schedule.type=manual}}"....
      

      Expected Behaviour: After migration, manually scheduled should not be triggered, unless if triggered by user.

      Steps to reproduce:

      Unfortunately I was not able to reproduce this issue, but something on customer instance did cause the issue to occur. I tried the following:

      1) Have Nexus orient instance with scripting enabled
      2) Create script task with manual schedule
      3) Run migrator to postgres
      4) Start Nexus with postgre

      Logs show that script task was not triggered

      2022-02-03 15:32:47,480+0000 INFO  [FelixStartLevel]  *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'test script task' [script] : state=WAITING
      2022-02-03 15:32:47,514+0000 INFO  [status-delayed-tasks-2-thread-1]  *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'test script task' [script] : state=WAITING
      

      Customer stated issue happens task is interrupted.

      1) Have Nexus orient instance with scripting enabled
      2) Create script task with manual schedule
      2a) Start the task in nexus (manual run).
      2b) STOP nexus/KILL the process/REBOOT the server – anything that causes an interruption to the task in flight.
      3) Run migrator to postgres
      4) Start Nexus with postgres

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sshamrai Sergii Shamrai
              Reporter:
              msurani Mahendra Surani
              Last Updated By:
              Sergii Shamrai Sergii Shamrai
              Team:
              NXRM - Mad Max
              Owner:
              Sergii Shamrai Sergii Shamrai
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title