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

Casc reload events seem to cause issues for this plugin.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • AWS ECS with Docker image based on the official one.

      Jenkins 2.303.3
      BFA Plugin 2.1.0
      Casc 1.54

      I have Jenkins instances that get the casc reload event fired regularly to allow them to synchronise the yaml from a Git repo.

      This seems to cause the Build Failure Analyser to always fail with a Null Pointer.

      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.findCauses(BuildFailureScanner.java:392)
      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.splitCauses(BuildFailureScanner.java:519)
      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.findIndications(BuildFailureScanner.java:438)
      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.scan(BuildFailureScanner.java:176)
      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.scanIfNotScanned(BuildFailureScanner.java:154)
      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.doScan(BuildFailureScanner.java:130)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625)
      at com.sonyericsson.jenkins.plugins.bfa.BuildFailureScanner.onCompleted(BuildFailureScanner.java:120)
      at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208)

      If I turn off the Casc reload then this doesn't occur and the scan works OK.

          [JENKINS-67238] Casc reload events seem to cause issues for this plugin.

          Stephen Fry added a comment -

          I see two issues here.

          1. The Mongo cache has an issue if you create a new one, call start and immediately ask for data. It can be null as the update thread may not have loaded the data yet.
          2. The Plugin doesn't handle the case with a casc reload event. This seems to update the knowledge base data bound property, with a new instance that has not been started. UI updates handled through configure handle the knowledge base updates.

          Fixing just 1 makes it work but won't benefit from the caching if you are calling reload a lot.

          Stephen Fry added a comment - I see two issues here. 1. The Mongo cache has an issue if you create a new one, call start and immediately ask for data. It can be null as the update thread may not have loaded the data yet. 2. The Plugin doesn't handle the case with a casc reload event. This seems to update the knowledge base data bound property, with a new instance that has not been started. UI updates handled through configure handle the knowledge base updates. Fixing just 1 makes it work but won't benefit from the caching if you are calling reload a lot.

          Since we aren't using casc yet at my company, this won't be at the top of my priority list to fix.

          I see that you offered to submit a PR for it but retracted it, if you feel up for doing the bugfix please do, otherwise I will have to carve out some time

          for looking at bugfixes to various stuff in the plugin.

          Tomas Westling added a comment - Since we aren't using casc yet at my company, this won't be at the top of my priority list to fix. I see that you offered to submit a PR for it but retracted it, if you feel up for doing the bugfix please do, otherwise I will have to carve out some time for looking at bugfixes to various stuff in the plugin.

          Stephen Fry added a comment -

          Yes, I will submit a PR. I just need to check this is OK with my boss.

          Stephen Fry added a comment - Yes, I will submit a PR. I just need to check this is OK with my boss.

          Stephen Fry added a comment -

          Do you have an example build environment for this. I'm getting some test failures before I even start....

          I was using this Docker image to build on.
           
          maven:3.8.4-jdk-11-slim
           
          Any ideas what might be wrong?

          Stephen Fry added a comment - Do you have an example build environment for this. I'm getting some test failures before I even start.... I was using this Docker image to build on.   maven:3.8.4-jdk-11-slim   Any ideas what might be wrong?

          Stephen Fry added a comment -

          maven:3.8.4-jdk-8 seems to get me building.

          Stephen Fry added a comment - maven:3.8.4-jdk-8 seems to get me building.

            t_westling Tomas Westling
            sfryffdc Stephen Fry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: