Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/remoting
  Commit: 49285828b1bab7276f66b6c3c6c51e64fe22bc5e
      
https://github.com/jenkinsci/remoting/commit/49285828b1bab7276f66b6c3c6c51e64fe22bc5e
  Author: Georg Öttl <[email protected]>
  Date:   2015-09-22 (Tue, 22 Sep 2015)

  Changed paths:
    M src/main/java/hudson/remoting/PipeWindow.java
    M src/main/java/org/jenkinsci/remoting/nio/FifoBuffer.java

  Log Message:
  -----------
  Thread starvation on close / terminate slaves channel.

The error happens when starting approximately 100 build jobs with "once only" 
build executors as used with the mesos plugin. In our scenario we have 
approximately 20 active build executors, that are disconnected at approximately 
the same time. During termination of the channels we get the thread starvation 
described below.

In Example below Lock 0x27a7 was acquired by the thread pool (on the channel), 
but required by RemoteInvocationHandler and NioChannelHub. The Fifo Buffer / 
Pipe Window never released the lock in the wait. So i introduced a timeout and 
this seems to do the trick.

"Computer.threadPoolForRemoting [#1748] for 
build4G-6G-mesos-70dd9b11-d5f4-43eb-b914-7604285a6e7c@9817" daemon prio=5 
tid=0x56ff nid=NA waiting
  java.lang.Thread.State: WAITING
blocks RemoteInvocationHandler [#6]@9927
blocks NioChannelHub keys=4 gen=1027971: Computer.threadPoolForRemoting 
[#114]@9708
  at java.lang.Object.wait(Object.java:-1)
  at org.jenkinsci.remoting.nio.FifoBuffer.write(FifoBuffer.java:336)
  at 
org.jenkinsci.remoting.nio.NioChannelHub$NioTransport.writeBlock(NioChannelHub.java:220)
  at 
hudson.remoting.AbstractByteArrayCommandTransport.write(AbstractByteArrayCommandTransport.java:83)
  at hudson.remoting.Channel.send(Channel.java:579)
  - locked <0x27a7> (a hudson.remoting.Channel)
  at hudson.remoting.ProxyOutputStream.write(ProxyOutputStream.java:141)
  - locked <0x27bb> (a hudson.remoting.ProxyOutputStream)
  at hudson.remoting.RemoteOutputStream.write(RemoteOutputStream.java:110)
  at hudson.remoting.Util.copy(Util.java:43)
  at hudson.remoting.JarLoaderImpl.writeJarTo(JarLoaderImpl.java:37)
  at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown Source:-1)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:608)
  at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:583)
  at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:542)
  at hudson.remoting.UserRequest.perform(UserRequest.java:121)
  at hudson.remoting.UserRequest.perform(UserRequest.java:49)
  at hudson.remoting.Request$2.run(Request.java:326)
  at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
  at 
jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:745)


  Commit: 6e4735f2396f5cc09298ea2ea40edecf9ac3a576
      
https://github.com/jenkinsci/remoting/commit/6e4735f2396f5cc09298ea2ea40edecf9ac3a576
  Author: Oleg Nenashev <[email protected]>
  Date:   2015-11-12 (Thu, 12 Nov 2015)

  Changed paths:
    M src/main/java/hudson/remoting/PipeWindow.java
    M src/main/java/org/jenkinsci/remoting/nio/FifoBuffer.java

  Log Message:
  -----------
  Merge pull request #60 from goettl79/master

Thread starvation on close / terminate slaves channel.


Compare: 
https://github.com/jenkinsci/remoting/compare/eab9c6f9aaf5...6e4735f2396f

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to