-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-32052 Improve WsStore fetch miss message #18840
HPCC-32052 Improve WsStore fetch miss message #18840
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32052 Jirabot Action Result: |
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.
@rpastrana I can merge this as-is, or you can address the comments. Please let me know which you prefer.
@@ -402,7 +402,7 @@ bool CDALIKVStore::fetch(const char * storename, const char * ns, const char * k | |||
xpath.appendf("/%s", key); | |||
if(!storetree->hasProp(xpath.str())) | |||
{ | |||
throw makeStringExceptionV(ECLWATCH_INVALID_QUERY_KEY, "DALI Keystore fetch: invalid key '%s' detected!", key); | |||
throw makeStringExceptionV(ECLWATCH_INVALID_QUERY_KEY, "DALI Keystore fetch: Could not find key '%s'!", key); |
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 is a slightly picky comment, but exceptions should not be used for expected behaviour. In this case it is expected that users will query they value of keys that do not exist - because the first time the value is used it will not be present.
Better would be to log at this point, return false and for the caller to make use of the return value..
@@ -402,7 +402,7 @@ bool CDALIKVStore::fetch(const char * storename, const char * ns, const char * k | |||
xpath.appendf("/%s", key); | |||
if(!storetree->hasProp(xpath.str())) | |||
{ | |||
throw makeStringExceptionV(ECLWATCH_INVALID_QUERY_KEY, "DALI Keystore fetch: invalid key '%s' detected!", key); | |||
throw makeStringExceptionV(ECLWATCH_INVALID_QUERY_KEY, "DALI Keystore fetch: Could not find key '%s'!", key); | |||
} | |||
else | |||
{ |
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.
Line 412 should be "return true;" - the return type is boolean, and this has a const char * argument (which will always be non-null).
The Line 412 return type issue should be fixed, it's outside the scope of this jira, but I don't mind fixing it in this pr, up to you. I agree w/ the exception issue in general, I supposed one could argue the missed hit is not expected, but more importantly, that change should be in it's own pr. |
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.
Thanks, I appreciate the changes. Please squash.
52ac968
to
89e45de
Compare
@ghalliday squashed |
- Changes log message to clarify simple fetch miss - Removes dependancy on exception on misses - Removes dbg logging of misses - Fixes invalid response type in CDALIKVStore::fetch Signed-off-by: Rodrigo Pastrana <[email protected]>
89e45de
to
8d2b067
Compare
Type of change:
Checklist:
Smoketest:
Testing: