[ 
https://issues.apache.org/jira/browse/JCLOUDS-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14059249#comment-14059249
 ] 

Luciano Sabença commented on JCLOUDS-624:
-----------------------------------------

I can post the stack trace from the exception been thrown:

{code}
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: 
java.util.concurrent.TimeoutException
        at 
com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
 ~[guava-17.0.jar:na]
        at 
org.jclouds.rest.internal.InvokeHttpMethod.invokeWithTimeout(InvokeHttpMethod.java:126)
 ~[jclouds-core-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at 
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:71) 
~[jclouds-core-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at 
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) 
~[jclouds-core-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at 
org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
 ~[jclouds-core-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at 
org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
 ~[jclouds-core-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at $Proxy75.getNode(Unknown Source) ~[na:na]
        at 
org.jclouds.chef.strategy.internal.ListNodesImpl$1$1.call(ListNodesImpl.java:76)
 ~[chef-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at 
org.jclouds.chef.strategy.internal.ListNodesImpl$1$1.call(ListNodesImpl.java:73)
 ~[chef-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
~[na:1.6.0_38]
        at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
~[na:1.6.0_38]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 ~[na:1.6.0_38]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
~[na:1.6.0_38]
        at java.lang.Thread.run(Thread.java:662) ~[na:1.6.0_38]
        at java.lang.Thread.getStackTrace(Thread.java:1479) ~[na:1.6.0_38]
        at 
org.jclouds.chef.strategy.internal.ListNodesImpl$1.apply(ListNodesImpl.java:73) 
~[chef-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at 
org.jclouds.chef.strategy.internal.ListNodesImpl$1.apply(ListNodesImpl.java:70) 
~[chef-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
java.util.concurrent.TimeoutException: null
{code}

I came with this problem after a detailed code analysis, but I didn't make any 
profile from the JVM. In fact, It is not hard to understand the problem when 
seeing the whole context and analysing the implementation of 
_invokeWithTimeout_ and of _ListNodes_ methods.

> Bug at ListNodes In ChefContext
> -------------------------------
>
>                 Key: JCLOUDS-624
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-624
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-chef
>    Affects Versions: 1.8.0
>            Reporter: Luciano Sabença
>            Assignee: Ignasi Barrera
>
> Hi.
> I've found a bug when using ListNodes in jclouds-chef. The problem is related 
> to the thread pool that is used when ListNodes is called. 
> When using ListNodes, for each node that exists in Chef, a new task is 
> submitted to the pool "USER_THREADS". Each one of these submitted tasks 
> generates another Runnable - to do the HTTP request -  and submits it to the 
> same thread pool. So, when we have a large number of nodes(an usual scenario 
> when dealing with Chef), all threads in the pool are blocked waiting its own 
> thread responsible to do the HTTP request and no thread is left to 
> effectively do the HTTP request. After the configured timeout, a lot of 
> java.util.concurrent.TimeoutException are thrown.
> I am already working to fix it and I will release a pull request soon (maybe, 
> in a few days).
> Thanks



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to