Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offheap cache clearing is broken #19

Closed
ocafebabe opened this issue Aug 28, 2015 · 2 comments
Closed

Offheap cache clearing is broken #19

ocafebabe opened this issue Aug 28, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@ocafebabe
Copy link
Contributor

Trying to clear an offheap cache results in an illegal state exception:

Cache<Integer, Integer> cache =
    CacheBuilder.offHeapCache().storage(new OffHeapByteBufferStore(8388608, 10)).build();
for (int i=0; i<5; i++) {
    cache.put(i, i);
}
cache.clear();

And as soon as clear is called I get:

java.lang.IllegalStateException: Queue full
    at java.util.AbstractQueue.add(AbstractQueue.java:98)
    at com.cetsoft.imcache.offheap.bytebuffer.OffHeapByteBufferStore.free(OffHeapByteBufferStore.java:225)
    at com.cetsoft.imcache.offheap.bytebuffer.OffHeapByteBufferStore.free(OffHeapByteBufferStore.java:214)
    at com.cetsoft.imcache.offheap.OffHeapCache.clear(OffHeapCache.java:254)
@yusufaytas
Copy link
Contributor

First of all, thanks a lot reporting this bug. Here's the story. This is a bug related to available buffers. Whenever free them, we were trying to add freed buffer index to bounded queue which is already in the bounded queue. So, we check buffer index and we clear it if available buffer don't contain index.

@yusufaytas yusufaytas added the bug label Aug 29, 2015
@yusufaytas yusufaytas added this to the Maintenance milestone Aug 29, 2015
@yusufaytas yusufaytas self-assigned this Aug 29, 2015
@yusufaytas
Copy link
Contributor

We've fixed the bug with following commit. Closing the issue.
9919144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants