Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36865

Stage view showing wrong pipeline data

    Details

    • Similar Issues:

      Description

      After running a few pipeline executions, if you delete the job and recreate it will show the proper pipeline while building, but after the pipeline has completed running it will revert to showing the pipeline from the previous (deleted) run. After looking at the code to the plugin, I was able to determine that there was a cache and found some code in the tests to invalidate it.

      I was able to workaround the issue by running the following code in the script console:

      import com.cloudbees.workflow.flownode.FlowNodeUtil
      
      FlowNodeUtil.CacheExtension ext = FlowNodeUtil.CacheExtension.all().get(0);
      ext.getExecutionCache().invalidateAll();
      ext.getRunCache().invalidateAll();
      

        Attachments

          Activity

          Hide
          svanoort Sam Van Oort added a comment -

          Thanks for reporting this – should be an easy fix. We've got a listener that invalidates cache entries upon rename, but not upon deletion. Should be easy to resolve by adding a an implementation for onDeleted(Item item) that handles the deletion case – we anticipated this class of caching issue but not the deletion case.

          Change will go here, should be easy to knock out for one of the next few releases: https://github.com/jenkinsci/pipeline-stage-view-plugin/blob/master/rest-api/src/main/java/com/cloudbees/workflow/flownode/FlowNodeUtil.java#L505

          Might be an opportunity to make the existing invalidation (which is rather broad) more specific, by computing URLs to invalidate.

          Show
          svanoort Sam Van Oort added a comment - Thanks for reporting this – should be an easy fix. We've got a listener that invalidates cache entries upon rename, but not upon deletion. Should be easy to resolve by adding a an implementation for onDeleted(Item item) that handles the deletion case – we anticipated this class of caching issue but not the deletion case. Change will go here, should be easy to knock out for one of the next few releases: https://github.com/jenkinsci/pipeline-stage-view-plugin/blob/master/rest-api/src/main/java/com/cloudbees/workflow/flownode/FlowNodeUtil.java#L505 Might be an opportunity to make the existing invalidation (which is rather broad) more specific, by computing URLs to invalidate.
          Hide
          svanoort Sam Van Oort added a comment -

          Antonio Beyah You're getting a comprehensive fix for this, which also redoes run data cache invalidation so that the cache invalidates deleted job entries, moves the entires for renamed jobs, and doesn't invalidate the whole cache. Should improve performance on masters with frequent job deletion/renaming.

          Show
          svanoort Sam Van Oort added a comment - Antonio Beyah You're getting a comprehensive fix for this, which also redoes run data cache invalidation so that the cache invalidates deleted job entries, moves the entires for renamed jobs, and doesn't invalidate the whole cache. Should improve performance on masters with frequent job deletion/renaming.
          Hide
          svanoort Sam Van Oort added a comment -

          Released with v1.7

          Show
          svanoort Sam Van Oort added a comment - Released with v1.7
          Hide
          0x89 Martin Sander added a comment -

          I still see this with v2.6. Sam Van Oort: should I re-open this issue?

          N.b. the workaround in the description does not work anymore (seems that getExecutionCache was removed), but this one did the trick for me:

          import com.cloudbees.workflow.flownode.FlowNodeUtil
          
          FlowNodeUtil.CacheExtension ext = FlowNodeUtil.CacheExtension.all().get(0);
          ext.getRunCache().invalidateAll();
          
          Show
          0x89 Martin Sander added a comment - I still see this with v2.6. Sam Van Oort : should I re-open this issue? N.b. the workaround in the description does not work anymore (seems that getExecutionCache was removed), but this one did the trick for me: import com.cloudbees.workflow.flownode.FlowNodeUtil FlowNodeUtil.CacheExtension ext = FlowNodeUtil.CacheExtension.all().get(0); ext.getRunCache().invalidateAll();
          Hide
          svanoort Sam Van Oort added a comment -

          Martin Sander There's a new fix to cache invalidation coming out (already merged to the master branch) – it'll be released once I can finish testing some community PRs for inclusion in the the pending release.  I wouldn't re-open yet, but if you're interested in trying that fix out, you can build a SNAPSHOT off the current master. 

          Show
          svanoort Sam Van Oort added a comment - Martin Sander There's a new fix to cache invalidation coming out (already merged to the master branch) – it'll be released once I can finish testing some community PRs for inclusion in the the pending release.  I wouldn't re-open yet, but if you're interested in trying that fix out, you can build a SNAPSHOT off the current master. 
          Hide
          sirisov Sergey Irisov added a comment - - edited

          I also saw this issue after deleting job builds via script console with

          job.getBuilds().each { it.delete() }
          

          Maybe this is not a real case. At least invalidating script in comments below helped me.

          Show
          sirisov Sergey Irisov added a comment - - edited I also saw this issue after deleting job builds via script console with job.getBuilds().each { it.delete() } Maybe this is not a real case. At least invalidating script in comments below helped me.

            People

            • Assignee:
              svanoort Sam Van Oort
              Reporter:
              antoniobeyah Antonio Beyah
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: