What steps will reproduce the problem?
1. wait for bad day at Google, when memcache service will work but it will work
extremly slow
2. try to do get of cached entity, it will take up to 3s for single get,
because of slow request to memcache
What is the expected output? What do you see instead?
Expected behaviour should be fallback after x ms (100-200ms) of memcache not
returning anything back to requesting datastore. Instead we wait for 3s or even
more to get single entity.
What version of the product are you using? On what operating system?
We are using objectify 3 and also 4, same problem. Problem accures only on
Google App Engine when their memcache is working slow.
MemcacheService should be replaced with AsyncMemcacheService which offeres get
with timeout, like this:
AsyncMemcacheService service = MemcacheServiceFactory.getAsyncMemcacheService();
if (service != null) {
try {
Future<Object> response = service.get(key);
return response.get(500, TimeUnit.MILLISECONDS);
} catch (InvalidValueException ive) {
log.warning("Serialization error: \n" + ive.getMessage());
return null;
} catch (MemcacheServiceException | InterruptedException | ExecutionException | TimeoutException e) {
log.warning("MemcacheServiceException: " + e.getMessage());
return null;
}
}
Original issue reported on code.google.com by d...@black.si on 18 Dec 2013 at 1:05
Original issue reported on code.google.com by
d...@black.si
on 18 Dec 2013 at 1:05