Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-24307

artifactCleanup user plugin - unable to set multiple cron jobs simultaneously

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.5.5
    • Fix Version/s: 7.17.2
    • Component/s: User Plugins
    • Labels:
      None
    • Severity:
      Medium
    • Regression:
      Yes
    • Release Notes:
      Yes

      Description

      Using the artifactCleanup user plugin from public GitHub with no changes in the groovy file.

      When configuring the JSON file for different repositories as below, it's not possible to run several jobs in parallel.

       

      {
       "policies": [
       {
       "cron": "0 53 11 ? * *",
       "repos": [
       "cleanup-1"
       ],
       "timeUnit": "month",
       "timeInterval": 1,
       "dryRun": false,
       "paceTimeMS": 500,
       "disablePropertiesSupport": true
       },
       {
       "cron": "0 53 11 ? * *",
       "repos": [
       "cleanup-2"
       ],
       "timeUnit": "day",
       "timeInterval": 3,
       "dryRun": false,
       "paceTimeMS": 500,
       "disablePropertiesSupport": true
       }
       ]
      }
      

       

      Steps to reproduce:

      1. Download the user plugin groovy and JSON files from GitHub
      2. Locate the plugin in $ARTIFACTORY_HOME/etc/artifactory/plugins
      3. Configure the JSON file with cron jobs to run simultaneously 
      4. Run the following REST API call - POST /api/plugins/reload

      Expected behavior - all jobs should start and delete the artifact matching the job conditions.

      Impact - artifacts that are scheduled for deletion are not getting deleted if another job is scheduled for that timeslot, which cause the system to quickly fill up.

       

      This is a regression since this action is working in Artifactory 7.4.3, but no longer from Artifactory 7.5.5

       

      Logs output:

      Actual behavior:

      2020-12-28T17:26:25.048Z [jfrt ] [INFO ] [b6e508b6b3b544f5] [artifactCleanup:-2            ] [http-nio-8081-exec-1] - Schedule job policy list: [[cron:0 28 17 ? * *, disablePropertiesSupport:true, dryRun:false, paceTimeMS:500, repos:[cleanup1], timeInterval:1, timeUnit:month], [cron:0 28 17 ? * *, disablePropertiesSupport:true, dryRun:false, paceTimeMS:500, repos:[cleanup2], timeInterval:3, timeUnit:day]]
      2020-12-28T17:26:25.056Z [jfrt ] [INFO ] [b6e508b6b3b544f5] [o.a.a.p.j.JobsPluginImpl:94   ] [http-nio-8081-exec-1] - Groovy job 'scheduledCleanup_0 28 17 ? * *' has been successfully scheduled to run.
      2020-12-28T17:26:25.058Z [jfrt ] [INFO ] [b6e508b6b3b544f5] [o.a.a.p.j.JobsPluginImpl:62   ] [http-nio-8081-exec-1] - Overriding existing job with name. 'scheduledCleanup_0 28 17 ? * *'.
      2020-12-28T17:26:25.061Z [jfrt ] [INFO ] [b6e508b6b3b544f5] [o.a.a.p.j.JobsPluginImpl:94   ] [http-nio-8081-exec-1] - Groovy job 'scheduledCleanup_0 28 17 ? * *' has been successfully scheduled to run.
      2020-12-28T17:26:25.064Z [jfrt ] [INFO ] [b6e508b6b3b544f5] [o.a.a.p.GroovyRunnerImpl:357  ] [http-nio-8081-exec-1] - Script 'artifactCleanup' loaded.
      
      2020-12-28T17:28:00.051Z [jfrt ] [INFO ] [5cc0032fa541ee1c] [artifactCleanup:-2            ] [art-exec-9          ] - Starting artifact cleanup for repositories [cleanup2], until 3 days ago with pacing interval 500 ms, dryrun: false, disablePropertiesSupport: true
      2020-12-28T17:28:00.077Z [jfrt ] [INFO ] [5cc0032fa541ee1c] [artifactCleanup:-2            ] [art-exec-9          ] - Removing all artifacts not downloaded since 2020/12/25 17:28
      2020-12-28T17:28:00.163Z [jfrt ] [INFO ] [5cc0032fa541ee1c] [artifactCleanup:-2            ] [art-exec-9          ] - Finished cleanup, deleting 0 artifacts that took up 0 bytes
      

       

      Expected behavior:

      2020-12-28T18:42:00.047Z [jfrt ] [INFO ] [fb484c2a42fe1902] [artifactCleanup:-2            ] [art-exec-1          ] - Policy settings for scheduled run at(0 42 18 ? * *): repo list([cleanup1]), timeUnit(month), timeInterval(1), paceTimeMS(500) dryrun(false) disablePropertiesSupport(true)
      2020-12-28T18:42:00.047Z [jfrt ] [INFO ] [27972bd5c344b792] [artifactCleanup:-2            ] [art-exec-2          ] - Policy settings for scheduled run at(0 42 18 ? * *): repo list([cleanup2]), timeUnit(day), timeInterval(3), paceTimeMS(500) dryrun(false) disablePropertiesSupport(true)
      2020-12-28T18:42:00.058Z [jfrt ] [INFO ] [fb484c2a42fe1902] [artifactCleanup:-2            ] [art-exec-1          ] - Starting artifact cleanup for repositories [cleanup1], until 1 months ago with pacing interval 500 ms, dryrun: false, disablePropertiesSupport: true
      2020-12-28T18:42:00.058Z [jfrt ] [INFO ] [27972bd5c344b792] [artifactCleanup:-2            ] [art-exec-2          ] - Starting artifact cleanup for repositories [cleanup2], until 3 days ago with pacing interval 500 ms, dryrun: false, disablePropertiesSupport: true
      2020-12-28T18:42:00.092Z [jfrt ] [INFO ] [27972bd5c344b792] [artifactCleanup:-2            ] [art-exec-2          ] - Removing all artifacts not downloaded since 2020/12/25 18:42
      2020-12-28T18:42:00.092Z [jfrt ] [INFO ] [fb484c2a42fe1902] [artifactCleanup:-2            ] [art-exec-1          ] - Removing all artifacts not downloaded since 2020/11/28 18:42
      2020-12-28T18:42:00.190Z [jfrt ] [INFO ] [fb484c2a42fe1902] [artifactCleanup:-2            ] [art-exec-1          ] - Finished cleanup, deleting 0 artifacts that took up 0 bytes
      2020-12-28T18:42:00.190Z [jfrt ] [INFO ] [27972bd5c344b792] [artifactCleanup:-2            ] [art-exec-2          ] - Finished cleanup, deleting 0 artifacts that took up 0 bytes
      

        Attachments

          Activity

              People

              Assignee:
              tomers Tomer Slutsky
              Reporter:
              snirba Snir Ben Ami
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: