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

Synchronization issue in pipeline SSE event publishing

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      similar issue to JENKINS-47725.

      But in blueocean code:

      at java.util.WeakHashMap.get(WeakHashMap.java:403)
      at io.jenkins.blueocean.events.PipelineEventListener.newMessage(PipelineEventListener.java:140)
      at io.jenkins.blueocean.events.PipelineEventListener.onNewHead(PipelineEventListener.java:73)
       

        Attachments

          Activity

          olamy Olivier Lamy created issue -
          Hide
          olamy Olivier Lamy added a comment -

          A temporary solution would be to use Collections.synchronizedMap on the WeakHashMap.

          A better solution would be to use a cache solution based on GuavaCache?

          Show
          olamy Olivier Lamy added a comment - A temporary solution would be to use Collections.synchronizedMap on the WeakHashMap. A better solution would be to use a cache solution based on GuavaCache?
          Hide
          olamy Olivier Lamy added a comment -

          cc Sam Van Oort wdyt?

          Show
          olamy Olivier Lamy added a comment - cc Sam Van Oort wdyt?
          Hide
          olamy Olivier Lamy added a comment -

          Vivek Pandey   branch blueocean-1.5.0-beta-x  created https://github.com/jenkinsci/blueocean-plugin/tree/blueocean-1.5.0-beta-x containing the simple fix using Collections.synchronizedMap

          Show
          olamy Olivier Lamy added a comment - Vivek Pandey    branch blueocean-1.5.0-beta-x  created https://github.com/jenkinsci/blueocean-plugin/tree/blueocean-1.5.0-beta-x  containing the simple fix using Collections.synchronizedMap
          Hide
          svanoort Sam Van Oort added a comment -

          Olivier Lamy Yeah, your comment about temporary vs. better solutions is pretty much what I said when I did the initial analysis.

          My suggestion would be to go the Guava Cache path - I don't think it's really any more code and it should thread better. Just make sure not to use a LoadingCache because its error-handling during loading operations is dubious.

          Long term I want to move Jenkins as a whole over to Caffeine caches though, because they are generally faster and better behaved than Guava.

          Show
          svanoort Sam Van Oort added a comment - Olivier Lamy Yeah, your comment about temporary vs. better solutions is pretty much what I said when I did the initial analysis. My suggestion would be to go the Guava Cache path - I don't think it's really any more code and it should thread better. Just make sure not to use a LoadingCache because its error-handling during loading operations is dubious. Long term I want to move Jenkins as a whole over to Caffeine caches though, because they are generally faster and better behaved than Guava.
          Hide
          svanoort Sam Van Oort added a comment -

          Guava caches with weak keys are less performant than WeakHashMaps on their own (get/set carries more overhead) but they will avoid creating a thread bottleneck for anything but operations on the same key.

          Show
          svanoort Sam Van Oort added a comment - Guava caches with weak keys are less performant than WeakHashMaps on their own (get/set carries more overhead) but they will avoid creating a thread bottleneck for anything but operations on the same key.
          Hide
          olamy Olivier Lamy added a comment -

          definitely +1 for Caffeine

          Show
          olamy Olivier Lamy added a comment - definitely +1 for Caffeine
          Hide
          olamy Olivier Lamy added a comment -
          Show
          olamy Olivier Lamy added a comment - pr using GuavaCache https://github.com/jenkinsci/blueocean-plugin/pull/1781
          Hide
          olamy Olivier Lamy added a comment -

          merged in master and  cherry-pick in branch release/1.5

          Show
          olamy Olivier Lamy added a comment - merged in master and  cherry-pick in branch release/1.5
          olamy Olivier Lamy made changes -
          Field Original Value New Value
          Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
          Resolution Fixed [ 1 ]
          vivek Vivek Pandey made changes -
          Summary Peformance issue at java.util.WeakHashMap.get(WeakHashMap.java:403) Performance fix in pipeline event SSE publisher
          vivek Vivek Pandey made changes -
          Summary Performance fix in pipeline event SSE publisher Synchronization issue in pipeline SSE event publishing
          Hide
          vivek Vivek Pandey added a comment -

          Released in blueocean 1.5.2 and 1.7.2.

          Show
          vivek Vivek Pandey added a comment - Released in blueocean 1.5.2 and 1.7.2.
          vivek Vivek Pandey made changes -
          Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

            People

            • Assignee:
              olamy Olivier Lamy
              Reporter:
              olamy Olivier Lamy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: