1. 05 5月, 2016 1 次提交
  2. 03 5月, 2016 1 次提交
  3. 09 3月, 2016 2 次提交
    • S
      Jenkins.getInstance() will be @Nonnull in Jenkins 2.0+ · 96150d3a
      Stephen Connolly 提交于
      - Code that is running from a plugin and on the master's JVM is guaranteed to never get null from this method (any cases where you do get null are bugs in core)
      - Code that is running from a plugin and on a remote JVM should never be allowed to load the Jenkins class in their classloader, so should never use Jenkins.getInstance()... we are annotating the method with @Nullable so that such code can have some evolution time
      - Code that is running in core and on one of two special paths should use the Jenkins.getInstanceOrNull() method so that the UI can be presented to users before the singleton has been instantiated / after the singleton has been destroyed
      - The remaining 95% of uses in core (and 100% of uses in plugins) can safely assume that the instance is never null
      96150d3a
    • S
      Revert "Jenkins.getInstance() should be non-null" · d1dfbd2b
      Stephen Connolly 提交于
      This reverts commit bb7c8fce.
      
      Closes #2090, I'll redo this as a PR... though if that PR is subject to multiple rounds of review before being merged then I will take that of evidence of the exact problem that committing directly was supposed to resolve... namely exponentially multiplying the effort required to make actual improvements to the code base.
      d1dfbd2b
  4. 08 3月, 2016 2 次提交
    • S
    • S
      Jenkins.getInstance() should be non-null · bb7c8fce
      Stephen Connolly 提交于
      - It is never too late to do the right thing.
      - The vast majority of usages of `Jenkins.getInstance()` in core currently assume that its return value is non-null
      - This commit changes those that are written to correctly check for non-null values will call `Jenkins.getInstanceOrNull()`
      - We deprecate the `Jenkins.getActiveInstance()` madness
      - I checked with @kohsuke who said not to bother with a PR and just commit this strongly opinionated change direct to master as a PR will just degrade into a bikeshedding.
      bb7c8fce
  5. 26 2月, 2016 1 次提交
  6. 03 2月, 2016 1 次提交
  7. 02 2月, 2016 1 次提交
  8. 30 1月, 2016 1 次提交
  9. 23 12月, 2015 1 次提交
  10. 02 12月, 2015 1 次提交
  11. 04 11月, 2015 1 次提交
  12. 20 10月, 2015 1 次提交
  13. 10 9月, 2015 2 次提交
  14. 21 8月, 2015 1 次提交
  15. 20 8月, 2015 1 次提交
  16. 11 8月, 2015 1 次提交
  17. 04 8月, 2015 2 次提交
  18. 31 7月, 2015 1 次提交
  19. 07 7月, 2015 1 次提交
    • S
      [FIXED JENKINS-28840] Deadlock between Queue.maintain and Executor.interrupt · 119fcbbf
      Stephen Connolly 提交于
      More fun here:
      
      - All this originates from Executor extending Thread.
      - There is funky logic in the lock handling code of the JVM that makes assumptions
        about how it might proceed with the lock when the thread holding the lock has its
        interrupt flag set.
      - Really it would be better if Executor did not extend Thread as that way we wouldn't
        have to deal with some of that complexity. But OTOH we are where we are and backwards
        compatibility may make such a change not possible without a lot of breakage.
      - Fixing the issue at hand, firstly requires that interrupting a Computer happens with the
        Queue lock held (to speed up tests we have Jenkins.cleanup get the lock for all Computers)
        That prevents the Queue maintain thread from getting caught
      - Secondly, when removing an executor from a computer we process the removal while
        holding the Queue lock, but we move the removal itself to a separate thread if we cannot
        get the Queue lock in order to avoid deadlock.
      - Also add helper methods to wrap tasks to be performed while holding the lock
        and a helper method for Runnables that exposes the tryLock functionality
      
      (cherry picked from commit 6f343dc7)
      119fcbbf
  20. 15 6月, 2015 1 次提交
    • S
      [FIXED JENKINS-28840] Deadlock between Queue.maintain and Executor.interrupt · 6f343dc7
      Stephen Connolly 提交于
      More fun here:
      
      - All this originates from Executor extending Thread.
      - There is funky logic in the lock handling code of the JVM that makes assumptions
        about how it might proceed with the lock when the thread holding the lock has its
        interrupt flag set.
      - Really it would be better if Executor did not extend Thread as that way we wouldn't
        have to deal with some of that complexity. But OTOH we are where we are and backwards
        compatibility may make such a change not possible without a lot of breakage.
      - Fixing the issue at hand, firstly requires that interrupting a Computer happens with the
        Queue lock held (to speed up tests we have Jenkins.cleanup get the lock for all Computers)
        That prevents the Queue maintain thread from getting caught
      - Secondly, when removing an executor from a computer we process the removal while
        holding the Queue lock, but we move the removal itself to a separate thread if we cannot
        get the Queue lock in order to avoid deadlock.
      - Also add helper methods to wrap tasks to be performed while holding the lock
        and a helper method for Runnables that exposes the tryLock functionality
      6f343dc7
  21. 09 6月, 2015 2 次提交
  22. 06 6月, 2015 1 次提交
  23. 05 6月, 2015 1 次提交
  24. 29 5月, 2015 1 次提交
    • J
      Null safety for removeExecutor. · 10401aa7
      Jesse Glick 提交于
      Sometimes observed at end of (passing) WorkflowTest.executorStepRestart in 1.596.1:
      Exception in thread "Executor #0 for slave0 : executing PlaceholderExecutable:job/demo/1/:null" java.lang.NullPointerException
      	at hudson.model.Computer.removeExecutor(Computer.java:869)
      	at hudson.model.Executor.run(Executor.java:272)
      10401aa7
  25. 15 5月, 2015 1 次提交
  26. 07 5月, 2015 1 次提交
  27. 05 5月, 2015 1 次提交
  28. 23 4月, 2015 2 次提交
  29. 20 4月, 2015 1 次提交
  30. 26 3月, 2015 4 次提交
  31. 25 3月, 2015 1 次提交