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

logging for cache put failures #1114

Merged
merged 7 commits into from
Nov 19, 2020
Merged

logging for cache put failures #1114

merged 7 commits into from
Nov 19, 2020

Conversation

bharatmotwani
Copy link
Contributor

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.

@bharatmotwani bharatmotwani changed the title Cache logs logging for cache put failures Nov 17, 2020
Copy link
Contributor

@michael-mclawhorn michael-mclawhorn left a 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.

Copy link
Contributor

@michael-mclawhorn michael-mclawhorn left a 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
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

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.

@bharatmotwani bharatmotwani merged commit 6f790ea into master Nov 19, 2020
@bharatmotwani bharatmotwani deleted the cache-logs branch November 19, 2020 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants