[
https://issues.apache.org/jira/browse/USERGRID-1277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15235037#comment-15235037
]
ASF GitHub Bot commented on USERGRID-1277:
------------------------------------------
GitHub user snoopdave opened a pull request:
https://github.com/apache/usergrid/pull/499
Application ID cache should not cache Optionals
Fix for https://issues.apache.org/jira/browse/USERGRID-1277
The Application ID cache in CpEntityManagerFactoryImpl caches
Optional<UUID> even when o.isPresent() is false. When there is a problem
retrieving an application ID from Cassandra and the ID comes back as null, we
cache that value and, until the cache entry expires 60 seconds later, the cache
returns null for that application and Usergrid throws an NPE, server error 500,
etc.
The cache logic should be simplified and we should cache UUIDs and not
Optionals.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/usergrid dont-cache-optionals
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/usergrid/pull/499.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #499
----
commit 177e06375351dbcff7f14e158814b47c53413d56
Author: Dave Johnson <[email protected]>
Date: 2016-04-08T22:51:14Z
Don't cache Optionals or nulls in app id cache.
commit 9486cdd3e0b2aeb3739dce8cb551fb3dad132148
Author: Dave Johnson <[email protected]>
Date: 2016-04-11T12:42:21Z
Fix but in app exists logic. All tests pass with app ID cache changes.
----
> Application ID cache should not cache Optionals
> -----------------------------------------------
>
> Key: USERGRID-1277
> URL: https://issues.apache.org/jira/browse/USERGRID-1277
> Project: Usergrid
> Issue Type: Bug
> Reporter: David Johnson
> Assignee: David Johnson
>
> The Application ID cache in CpEntityManagerFactoryImpl caches Optional<UUID>
> even when o.isPresent() is false. When there is a problem retrieving an
> application ID from Cassandra and the ID comes back as null, we cache that
> value and, until the cache entry expires 60 seconds later, the cache returns
> null for that application and Usergrid throws an NPE, server error 500, etc.
> The cache logic should be simplified and we should cache UUIDs and not
> Optionals.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)