Queue Full exception

59 views
Skip to first unread message

Lee Campus

unread,
Dec 18, 2009, 3:43:25 PM12/18/09
to haze...@googlegroups.com
Hello Talip,

After several successful mvn based testng test runs of our hazelcast based application, some subsequent testng test run fails due to the following queue full exception.  However, since I am running Hazelcast.shutdown() after testing completes, I don't know why.  By the way, I am using the default configuration for hazelcast queue size.  I certainly could increase it, but each test run uses only a very small number of map entries and shouldn't require a very large queue. 

Please advise. Thanks!

java.lang.IllegalStateException: Queue full
        at java.util.AbstractQueue.add(AbstractQueue.java:71)
        at java.util.concurrent.ArrayBlockingQueue.add(ArrayBlockingQueue.java:209)
        at com.hazelcast.impl.ExecutorManager.init(ExecutorManager.java:132)
        at com.hazelcast.impl.Node.init(Node.java:319)
        at com.hazelcast.impl.Node.start(Node.java:363)
        at com.hazelcast.impl.FactoryImpl.init(FactoryImpl.java:80)
        at com.hazelcast.impl.FactoryImpl.initialChecks(FactoryImpl.java:232)
        at com.hazelcast.impl.FactoryImpl$MProxyImpl.ensure(FactoryImpl.java:1481)
        at com.hazelcast.impl.FactoryImpl$MProxyImpl.putIfAbsent(FactoryImpl.java:1605)

Talip Ozturk

unread,
Dec 25, 2009, 1:15:44 AM12/25/09
to hazelcast
Is there a test case that I can run and reproduce? Also see how we test things..
http://code.google.com/docreader/#p=hazelcast&s=hazelcast&t=ClusterTestHowTo

-talip

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

Lee Campus

unread,
Dec 29, 2009, 2:06:01 PM12/29/09
to haze...@googlegroups.com
Talip,

The queue full exception occurs after running several TestNG unit tests against the SEAM managed class defined below. 

Can you tell me, in general, what are possible causes for a queue full exception?  I suppose the answer is obvious and I may need to simply check to see how many items we are adding (though it should theoretically be a very small number - e.g 10-20) during unit test to see if we are somehow exceeding a reasonable number.

Thanks!

@Name("objectAccessor")
@Scope(ScopeType.APPLICATION)
@AutoCreate
@Startup
public class ObjectAccessor
{
    public ObjectId create(ObjectId objectId, Object object)
    {
        if (objectMap.putIfAbsent(objectId, object) != null)
            throw new Exception(objectId.toString());

        return objectId;
    }

    public Object read(ObjectId objectId)
    {
        Object object = objectMap.get(objectId);

        if (!objectMap.containsKey(objectId))
            throw new Exception(objectId.toString());

        return object;
    }

    public void update(ObjectId objectId, Object object)
    {
        if (objectMap.put(objectId, object) == null)
        {
            objectMap.remove(objectId);
            throw new Exception(objectId.toString());
        }
    }

    public void delete(ObjectId objectId)
    {
        if (objectMap.remove(objectId) == null)
            throw new Exception(objectId.toString());
    }

    private ObjectId getObjectId(Object object)
    {
        return new ObjectId(((object instanceof CreateObject) ? "create-" : "update-")
                + idGenerator.newId());
    }

    @PostConstruct
    public void postConstruct()
    {
        objectMap = Hazelcast.getMap("objects");
        idGenerator = Hazelcast.getIdGenerator("object-ids");
    }

    @PreDestroy
    public void preDestroy()
    {
        Hazelcast.shutdown();
    }

    private IMap<ObjectId, Object> objectMap = null;

    private IdGenerator idGenerator = null;
Reply all
Reply to author
Forward
0 new messages