Potential NPE in BlockedBecauseOfBuildInProgress#getDescription()

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      This NPE may happen in the case of race condition.

      1) AbstractProject#getCauseOfBlockage() checks for non-concurrent running build in order to generate a cause of blockage
      2) If the getCauseOfBlockage() happens in the context not synced with queue, after isLogUpdated() && !isConcurrentBuild() there may be a context switch.
      3) Build may complete and get deleted before we actually call getLastBuild() in the code
      4) If it happens, BlockedBecauseOfBuildInProgress may get null in the constructor
      5) Then, BlockedBecauseOfBuildInProgress#getDescription() will start throwing NPEs

            Assignee:
            Oleg Nenashev
            Reporter:
            Oleg Nenashev
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: