-
Notifications
You must be signed in to change notification settings - Fork 96
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
logging for cache put failures #1114
Conversation
fili-core/src/main/java/com/yahoo/bard/webservice/logging/blocks/BardCacheInfo.java
Show resolved
Hide resolved
fili-core/src/main/java/com/yahoo/bard/webservice/logging/blocks/BardCacheInfo.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would look to improve the specificity on the checksum building exception block.
Needs Changelog and Tests.
...src/main/java/com/yahoo/bard/webservice/web/responseprocessors/CacheV2ResponseProcessor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this for expediency, but I want tests around the new behaviors including the config controlled behavior.
Also, the MD5Checksum code would probably work better as an injectable so that it's easier to mock and test.
@@ -105,6 +118,13 @@ public void processResponse(JsonNode json, DruidAggregationQuery<?> druidQuery, | |||
); | |||
} | |||
} catch (Exception e) { | |||
//mark and log the cache put failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a test.
* | ||
* @return String representation of the Cksum | ||
*/ | ||
public static String getMD5Cksum(String cacheKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better injected.
@@ -148,6 +151,13 @@ public void writeCache( | |||
); | |||
} | |||
} catch (Exception e) { | |||
//mark and log the cache put failure | |||
CACHE_SET_FAILURES.mark(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a test.
if (SYSTEM_CONFIG.getBooleanProperty(WAIT_FOR_FUTURE, false)) { | ||
return client.set(key, expirationInSeconds, value).get(); | ||
} else { | ||
return client.set(key, expirationInSeconds, value) != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two paths could use a test to guarantee config results in the correct behaviors.
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.