Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/jenkins
  Commit: fd6c6aff929be9818f4eb4b84ed6b4593356853f
      
https://github.com/jenkinsci/jenkins/commit/fd6c6aff929be9818f4eb4b84ed6b4593356853f
  Author: Oleg Nenashev <o.v.nenas...@gmail.com>
  Date:   2016-11-20 (Sun, 20 Nov 2016)

  Changed paths:
    M core/src/main/java/hudson/Launcher.java

  Log Message:
  -----------
  [JENKINS-23271] - Prevent early deallocation of the Proc instance by GC in 
ProcStarter#join() (#2635)

* [JENKINS-23271] - Prevent the prelimimary deallocation of the Proc instance 
by GC

It is a hackish way, which likely prevents a preliminary deallocation of the 
spawned RemoteProc instance, which we see in JENKINS-23271. Proc instance was 
not actually required in the original code since we were creating and using 
RemoteInvocationHandler wrapper only, and the theory discussed with @stephenc 
was that object gets removed by Java8 garbage collector before we get into 
join().

This fix enforces the persistency of ProcStarter#start() result by adding 
logging and the enforced volatile field (maybe the last one is not really 
required, but JIT compiler in Java implementations may be smart enough to skip 
unused loggers)

This is a pretty old fix from August, which has been soak tested on my instance 
for several weeks (mid-August => Jenkins World). On the reference instance 
(just a small Jenkins instance with 4 agents and very frequent builds with 
CommandInterpreter steps) I saw 2 failures over the period. On the fixed 
instance - 0. It does not proof anything, but at least the fix was soak tested 
a bit

* [JENKINS-23271] - Get rid of the procHolderForJoin field

* [JENKINS-23271] - Also put the check into the finally statement as @stephenc 
proposed

* Remove assert


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to