LocalLoadingCache doesn't ever expand/rehash #1055

Closed
gissuebot opened this Issue Oct 31, 2014 · 18 comments

Comments

Projects
None yet
3 participants
@gissuebot

Original issue created by Ionized on 2012-07-04 at 12:03 AM


No matter how many elements get loaded into the LoadingCache, expand() on the Segment never gets called (it gets called on put(), but not on getOrLoad())

The following code reproduces the issue:

CacheLoader<String, Object> loader = new CacheLoader<String, Object>() {
    @Override
    public Object load(String key) throws Exception {
        return key + 1;
    }
};
LoadingCache<String, Object> cache = CacheBuilder.newBuilder().build(
        loader);

for (int i = 0; i < 100000; i++) {
    cache.getUnchecked(i + "");
}

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by Ionized on 2012-07-04 at 12:12 AM


I of course meant LocalLoadingCache, not LoacalLoadingCache ;)

Original comment posted by Ionized on 2012-07-04 at 12:12 AM


I of course meant LocalLoadingCache, not LoacalLoadingCache ;)

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by Ionized on 2012-07-04 at 12:13 AM


This is using guava-12.0

Original comment posted by Ionized on 2012-07-04 at 12:13 AM


This is using guava-12.0

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by punya.biswal on 2012-07-04 at 06:08 AM


The same problem arises when using Cache<K, V>#get(K, Callable<V>).

Original comment posted by punya.biswal on 2012-07-04 at 06:08 AM


The same problem arises when using Cache<K, V>#get(K, Callable<V>).

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by wasserman.louis on 2012-07-05 at 12:53 PM


This seems...really odd. What leads you to the conclusion that expand() never gets called?

Original comment posted by wasserman.louis on 2012-07-05 at 12:53 PM


This seems...really odd. What leads you to the conclusion that expand() never gets called?

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by kak@google.com on 2012-07-05 at 03:03 PM


(No comment entered for this change.)


Status: Started
Owner: wasserman.louis
Labels: Milestone-Release13, Package-Cache, Type-Defect
CC: fry@google.com

Original comment posted by kak@google.com on 2012-07-05 at 03:03 PM


(No comment entered for this change.)


Status: Started
Owner: wasserman.louis
Labels: Milestone-Release13, Package-Cache, Type-Defect
CC: fry@google.com

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by fry@google.com on 2012-07-05 at 03:13 PM


Wow, this is bad. Why didn't anyone complain sooner???

Original comment posted by fry@google.com on 2012-07-05 at 03:13 PM


Wow, this is bad. Why didn't anyone complain sooner???

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by wasserman.louis on 2012-07-05 at 03:18 PM


I'm curious myself why this wasn't picked up sooner...but I'm going to go add expansion tests to all the other custom hash table implementations in Guava now.

Original comment posted by wasserman.louis on 2012-07-05 at 03:18 PM


I'm curious myself why this wasn't picked up sooner...but I'm going to go add expansion tests to all the other custom hash table implementations in Guava now.

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by fry@google.com on 2012-07-05 at 03:50 PM


For the record, this was introduced in 85ea291 on Oct 3, 2011.

Original comment posted by fry@google.com on 2012-07-05 at 03:50 PM


For the record, this was introduced in 85ea291 on Oct 3, 2011.

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by wasserman.louis on 2012-07-05 at 03:51 PM


That's...many months for a bug this bad to go unnoticed.

Original comment posted by wasserman.louis on 2012-07-05 at 03:51 PM


That's...many months for a bug this bad to go unnoticed.

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by kak@google.com on 2012-07-05 at 04:18 PM


The fix for this is submitted internally...will definitely make it into 13.0-rc2 and 13.0-final.


Status: Fixed

Original comment posted by kak@google.com on 2012-07-05 at 04:18 PM


The fix for this is submitted internally...will definitely make it into 13.0-rc2 and 13.0-final.


Status: Fixed

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by dterrell on 2012-07-10 at 04:02 AM


I noticed this is already backported to the release12 branch, any idea when that might ship? We're very excited for this fix. :)

Original comment posted by dterrell on 2012-07-10 at 04:02 AM


I noticed this is already backported to the release12 branch, any idea when that might ship? We're very excited for this fix. :)

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by wasserman.louis on 2012-07-10 at 10:45 AM


Extremely soon, hopefully within a day or two. We realize how big an issue this is. (We're also working on getting a JDK 5 backport out, so users who want e.g. Android Froyo compatibility aren't stuck on also-affected 11.0.2.)

Original comment posted by wasserman.louis on 2012-07-10 at 10:45 AM


Extremely soon, hopefully within a day or two. We realize how big an issue this is. (We're also working on getting a JDK 5 backport out, so users who want e.g. Android Froyo compatibility aren't stuck on also-affected 11.0.2.)

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by kurt.kluever on 2012-07-10 at 06:58 PM


12.0.1 is shipped and live in Maven Central. See the corresponding announcement here:
https://plus.sandbox.google.com/118010414872916542489/posts/DZZAt5shdW4

Thanks!

Original comment posted by kurt.kluever on 2012-07-10 at 06:58 PM


12.0.1 is shipped and live in Maven Central. See the corresponding announcement here:
https://plus.sandbox.google.com/118010414872916542489/posts/DZZAt5shdW4

Thanks!

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by cpovirk@google.com on 2012-07-11 at 08:33 PM


(No comment entered for this change.)

Original comment posted by cpovirk@google.com on 2012-07-11 at 08:33 PM


(No comment entered for this change.)

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by pascal.gelinas6 on 2012-08-01 at 03:10 PM


Any chances for this fix to be backported to version 11? We're stuck with java 1.5 (due to corporate reasons, sadly) and we'd like to have this fix too. It might be a long shot since you dropped the 1.5 support, but I had to try ;)
Thanks!

Original comment posted by pascal.gelinas6 on 2012-08-01 at 03:10 PM


Any chances for this fix to be backported to version 11? We're stuck with java 1.5 (due to corporate reasons, sadly) and we'd like to have this fix too. It might be a long shot since you dropped the 1.5 support, but I had to try ;)
Thanks!

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by wasserman.louis on 2012-08-01 at 03:22 PM


You should reread comment 13. (The JDK 5 backport of Guava 12 is accessible at https://github.com/google/guava/commits/master , but we're still deciding how to package it for the long term, I think?)

Original comment posted by wasserman.louis on 2012-08-01 at 03:22 PM


You should reread comment 13. (The JDK 5 backport of Guava 12 is accessible at https://github.com/google/guava/commits/master , but we're still deciding how to package it for the long term, I think?)

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by wasserman.louis on 2012-08-01 at 03:34 PM


To clarify: we are committed to providing a JDK5-compatible backport of 12, 13, and future releases, though we're still working out Maven shenanigans right now.

Original comment posted by wasserman.louis on 2012-08-01 at 03:34 PM


To clarify: we are committed to providing a JDK5-compatible backport of 12, 13, and future releases, though we're still working out Maven shenanigans right now.

@gissuebot

This comment has been minimized.

Show comment Hide comment
@gissuebot

gissuebot Nov 1, 2014

Original comment posted by michaelbdent on 2012-09-13 at 05:40 AM


Any update on 11.0.3? Or even better, any updates on JDK5-compat versions of newer releases? We will be stuck supporting Java 1.5 for the foreseeable future as well. Thanks

Original comment posted by michaelbdent on 2012-09-13 at 05:40 AM


Any update on 11.0.3? Or even better, any updates on JDK5-compat versions of newer releases? We will be stuck supporting Java 1.5 for the foreseeable future as well. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment