-
Notifications
You must be signed in to change notification settings - Fork 723
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
[BACKLOG-39705] Remove from Region Cache not removing 1st level cache… #5511
Conversation
I'm normally don't care for updating commit message but I feel in this instance, it make sense to add |
probably adding [ppp-4826] is a good idea. I leave the proof to the QA team. I have seen it locally. Please feel free to run it thought the IT test since you are in a good position to do that. |
@tkafalas Do you provide any proof that the code changes works? Either the steps to reproduce noted in https://hv-eng.atlassian.net/browse/BACKLOG-39705 And some execution of integration tests mentioned here: https://hv-eng.atlassian.net/browse/BACKLOG-39705?focusedCommentId=1940152 For my POC fix (https://hv-eng.atlassian.net/browse/BACKLOG-39705?focusedCommentId=1940968) I had to update a couple more functions for get the integration test to pass like |
@@ -400,7 +400,10 @@ public Set getAllEntriesFromRegionCache( String region ) { | |||
public void removeFromRegionCache( String region, Object key ) { | |||
if ( checkRegionEnabled( region ) ) { | |||
HvCache hvcache = (HvCache) regionCache.get( region ); | |||
hvcache.evictEntityData( (String) key ); | |||
try ( SessionImpl session = (SessionImpl) hvcache.getSessionFactory().openSession() ) { |
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.
Not a blocker
For CacheManager#removeFromRegionCache
shouldn't be a catch
statement statement here and at least a log line here, instead of shallowing the error.
The log level can be [error, debug, trace] just people can debug it in the field without a code change.
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.
The try is to guarantee that open session gets closed. an exception will bubble up
hvcache.evictEntityData( (String) key ); | ||
try ( SessionImpl session = (SessionImpl) hvcache.getSessionFactory().openSession() ) { | ||
hvcache.getStorageAccess().removeFromCache( key, session ); | ||
hvcache.evictEntityData( (String) 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.
Not a blocker.
similar comment for https://github.com/pentaho/pentaho-platform/pull/5511/files#r1471722021
shouldn't we add a log statement with level [error, debug, trace,..] for MappingException
to class that will handle hvcache.evictEntityData( (String) key );
Lines 135 to 141 in cefd702
@Override public void evictEntityData( String entityName ) { | |
try { | |
evictEntityData( getSessionFactory().getMetamodel().entityPersister( entityName ) ); | |
} catch ( MappingException e) { | |
//Nothing to do if the entry is not there. | |
} | |
} |
The MappingException was being shallowed and there was no way to find this out except for a developer attaching a debugger.
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 don't believe so. That exception happens when trying to remove the 2nd level cache which is only used in the carteStatusCache to persist the log xml to a file. The fact that there is no 2nd level cache persister for these entries is not an error and logging it would just produce spam.
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.
The use case would be if we need to customer's environment which we don't have access, but they can give us log files. So would don't have to deploy custom jars and we can't attach debuggers. Customer support or whoever would simply have to adjust logging levels in log4j.
if you find it useful or not address it or not. I'm fine either way.
This comment has been minimized.
This comment has been minimized.
SonarQube Quality Gate |
Note:Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system. |
|
… entry.