Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/maven-plugin
  Commit: b145d5925ddeae2d697743920da204e6991375ac
      
https://github.com/jenkinsci/maven-plugin/commit/b145d5925ddeae2d697743920da204e6991375ac
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2014-07-09 (Wed, 09 Jul 2014)

  Changed paths:
    M src/main/java/hudson/maven/SplittableBuildListener.java

  Log Message:
  -----------
  [FIXED JENKINS-23098]

Reference: ZD-19531

Looking at [4], one notices that three threads are in an effective dead lock 
state around synchronizeOnMark. I extracted relevant part into [5].

Thread #1661 is trying to report a discovered mark, but blocking [1]. Thread 
#1665 is inside synchronizeOnMark, on markCountLock.wait() [2]. Thread #1667 is 
stuck on Future.get() and hasn't returned [3], which holds the lock that blocks 
[1] from unblocking [2].

The root problem is that synchronizeOnMark method is never meant to be 
concurrently executed. But given the way the lock is used, if one thread gets 
to wait(), it's possible that another thread would come along and go into this 
function.

In this change, I'm preventing that by introducing another lock to serialize 
the execution of the entire synchronizeOnMark() call. I'm not using the "this" 
object for locking because it's already used for another purpose (see the 
lock() method)

I'm not yet clear on why the synchronizeOnMark() method is called concurrently 
to begin with. The interaction with the -T option of Maven is suspected.

[1] https://gist.github.com/kohsuke/374c22e737a77c9b0421#file-gistfile1-txt-L2
[2] https://gist.github.com/kohsuke/374c22e737a77c9b0421#file-gistfile1-txt-L34
[3] https://gist.github.com/kohsuke/374c22e737a77c9b0421#file-gistfile1-txt-L71
[4] https://gist.github.com/abayer/7ff4de807c6373eec40d
[5] https://gist.github.com/kohsuke/374c22e737a77c9b0421


-- 
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