[infinispan-issues] [JBoss JIRA] Commented: (ISPN-1086) IndexOutOfBoundsException for DistributedExecutorService with a single node cache
Ming Fai Ma (JIRA)
jira-events at lists.jboss.org
Thu May 5 13:21:18 EDT 2011
[ https://issues.jboss.org/browse/ISPN-1086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600142#comment-12600142 ]
Ming Fai Ma commented on ISPN-1086:
-----------------------------------
i patched my local infinispan to make
{code}
public void execute(Runnable command) {
...
Address randomClusterMemberOtherThanSelfAddress = randomClusterMemberOtherThanSelf();
if (randomClusterMemberOtherThanSelfAddress!=null) executeFuture(randomClusterMemberOtherThanSelf(), cmd);
...
{code}
and
{code}
protected Address randomClusterMemberOtherThanSelf() {
List<Address> l = randomClusterMembers(1);
return l!=null && l.size()>0?l.get(0):null;
}
{code}
The IndexOutOfBoundsException won't be thrown anymore but the task still won't run. the log say:
2011-05-06 01:14:45,980 WARN [DefaultExecutorService ] ISPN00008: Can not select 1 random members for []
the same DistributedCallable does work if i use submitEverywhere
so my question is, should the submit() method just send the local node if there is only one node in the cluster?
> IndexOutOfBoundsException for DistributedExecutorService with a single node cache
> ---------------------------------------------------------------------------------
>
> Key: ISPN-1086
> URL: https://issues.jboss.org/browse/ISPN-1086
> Project: Infinispan
> Issue Type: Bug
> Components: Distributed Cache
> Affects Versions: 5.0.0.CR1
> Reporter: Ming Fai Ma
> Assignee: Manik Surtani
> Priority: Minor
>
> I'm just trying the distributed executor in 5.0.0.CR1. My first test is to start a cache with one member only (but with clustered cache configuration as it is required). When I submitted a runnable in to a DistributedExecutorService with a single node, it got an error:
> {code}
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> at java.util.ArrayList.RangeCheck(ArrayList.java:547)
> at java.util.ArrayList.get(ArrayList.java:322)
> at org.infinispan.distexec.DefaultExecutorService.randomClusterMemberOtherThanSelf(DefaultExecutorService.java:451)
> at org.infinispan.distexec.DefaultExecutorService.execute(DefaultExecutorService.java:278)
> {code}
> there is only one member and no "cluster member other than self". Should the single node use case be supported? I suppose there is no harm to allow user to use the executor in a single node, for example, for unit testing.
> if this use case is not supported, I suggest to throw an exception with better explanation
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list