java.util.concurrent.RejectedExecutionException occurs when listing nodes in EC2

239 views
Skip to first unread message

Nirmal Fernando

unread,
Nov 8, 2012, 11:20:54 PM11/8/12
to jcl...@googlegroups.com
Hi All,

Appreciate a quick response on this.

Here's the scenario:

I'm associating a public IP for a node (after it is started), like below:

String ip = ec2Client.getElasticIPAddressServices().allocateAddressInRegion(region);
        ec2Client.getElasticIPAddressServices().associateAddressInRegion(region,ip, node.getProviderId());

Then I list nodes like below:

Set<? extends ComputeMetadata> set = computeService.listNodes();

Then I'm getting following exception at [1].

Any idea what's going wrong? This comes continuously.

[1]
java.util.concurrent.RejectedExecutionException
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
    at org.jclouds.concurrent.config.DescribingExecutorService.execute(DescribingExecutorService.java:105)
    at org.jclouds.concurrent.Futures$FutureListener.addListener(Futures.java:122)
    at org.jclouds.concurrent.Futures$ListenableFutureAdapter.addListener(Futures.java:153)
    at com.google.common.util.concurrent.Futures.transform(Futures.java:270)
    at com.google.common.util.concurrent.Futures.transform(Futures.java:384)
    at org.jclouds.concurrent.Futures.compose(Futures.java:270)
    at org.jclouds.http.TransformingHttpCommandExecutorServiceImpl.submit(TransformingHttpCommandExecutorServiceImpl.java:54)
    at org.jclouds.http.TransformingHttpCommandImpl.execute(TransformingHttpCommandImpl.java:73)
    at org.jclouds.rest.internal.AsyncRestClientProxy.createListenableFutureForHttpRequestMappedToMethodAndArgs(AsyncRestClientProxy.java:248)
    at org.jclouds.rest.internal.AsyncRestClientProxy.invoke(AsyncRestClientProxy.java:148)
    at $Proxy89.describeRegions(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jclouds.concurrent.internal.SyncProxy.invoke(SyncProxy.java:159)
    at $Proxy90.describeRegions(Unknown Source)
    at org.jclouds.ec2.suppliers.DescribeRegionsForRegionURIs.get(DescribeRegionsForRegionURIs.java:49)
    at org.jclouds.ec2.suppliers.DescribeRegionsForRegionURIs.get(DescribeRegionsForRegionURIs.java:36)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:91)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:72)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3579)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2372)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2335)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2250)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3980)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3984)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4868)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:140)
    at org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:48)
    at org.jclouds.location.suppliers.derived.RegionIdsFromRegionIdToURIKeySet.get(RegionIdsFromRegionIdToURIKeySet.java:36)
    at org.jclouds.util.Suppliers2$SupplierComposition.get(Suppliers2.java:107)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:91)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:72)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3579)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2372)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2335)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2250)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3980)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3984)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4868)
    at org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:140)
    at org.jclouds.aws.ec2.compute.strategy.AWSEC2ListNodesStrategy.pollRunningInstances(AWSEC2ListNodesStrategy.java:71)
    at org.jclouds.ec2.compute.strategy.EC2ListNodesStrategy.listDetailsOnNodesMatching(EC2ListNodesStrategy.java:87)
    at org.jclouds.ec2.compute.strategy.EC2ListNodesStrategy.listNodes(EC2ListNodesStrategy.java:82)
    at org.jclouds.ec2.compute.strategy.EC2ListNodesStrategy.listNodes(EC2ListNodesStrategy.java:59)
    at org.jclouds.compute.internal.BaseComputeService.listNodes(BaseComputeService.java:342)
    at ....



--

Thanks & regards,
Nirmal

Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/

Adrian Cole

unread,
Nov 9, 2012, 1:21:21 AM11/9/12
to jcl...@googlegroups.com

Hmm.. any chance something is calling close on the context between these calls?

-A

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Nirmal Fernando

unread,
Nov 9, 2012, 1:24:06 AM11/9/12
to jcl...@googlegroups.com
On Fri, Nov 9, 2012 at 11:51 AM, Adrian Cole <adrian...@gmail.com> wrote:

Hmm.. any chance something is calling close on the context between these calls?

Oh.. yes... I'm calling context.close() after associating the public IP. Shouldn't I call that?
 

Adrian Cole

unread,
Nov 9, 2012, 1:31:49 AM11/9/12
to jcl...@googlegroups.com

Yeah, the provider specific and compute service context use the same threadpool.

Nirmal Fernando

unread,
Nov 9, 2012, 1:59:48 AM11/9/12
to jcl...@googlegroups.com
On Fri, Nov 9, 2012 at 12:01 PM, Adrian Cole <adrian...@gmail.com> wrote:

Yeah, the provider specific and compute service context use the same threadpool.

I see... so should one ever call "context.close()" ?
 

Adrian Cole

unread,
Nov 9, 2012, 12:46:33 PM11/9/12
to jcl...@googlegroups.com
On Fri, Nov 9, 2012 at 3:59 AM, Nirmal Fernando <nir...@wso2.com> wrote:
>
>
>
> On Fri, Nov 9, 2012 at 12:01 PM, Adrian Cole <adrian...@gmail.com>
> wrote:
>>
>> Yeah, the provider specific and compute service context use the same
>> threadpool.
>
> I see... so should one ever call "context.close()" ?
well, one shouldn't call context.close() if they are still using it :)
Reply all
Reply to author
Forward
0 new messages