-
Notifications
You must be signed in to change notification settings - Fork 738
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
Improve the error reporting when j9shmem_getDir() failed. #5151
Conversation
Manually set HOME to NFS:
The reason JVMSHRC831E shows up twice is because we try getting the cache dir both in checkIfCacheExists() and SH_OSCache::commonStartup(). Without this change, there were also 2 NLS messages printed out in checkIfCacheExists() and SH_OSCache::commonStartup(). |
Is it much work to fix the error to only print once? |
1. Change j9shmem_getDir() to return different error code for different failures. 2. Change the caller of j9shmem_getDir()to print new NLS messages according to the error code returned from j9shmem_getDir(). 3. Update the test code to check if j9shmem_getDir() returns a negative value instead of -1. Fixes eclipse-openj9#5134 Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
We need to change the signature of SH_OSCache::getCacheDir() to control whether the NLS messages should be printed. There are about 20 callers. |
jenkins test sanity win,plinux jdk11 |
Seems better done separately. |
#if !defined(WIN32) && !defined(WIN64) | ||
/* Get platform default cache directory */ | ||
rc = j9shmem_getDir(NULL, J9SHMEM_GETDIR_APPEND_BASEDIR, defaultCacheDir, J9SH_MAXPATH); | ||
if (-1 == rc) { | ||
if (-1 == j9shr_getCacheDir(vm, NULL, defaultCacheDir, J9SH_MAXPATH, vm->sharedCacheAPI->cacheType)) { |
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 condition will always be false.
- @internal J9PORT_ERROR_SHMEM* range from at -170 to -199 to match hyporterror.h codes.
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 think that is intentional? If it did happen we'd hit the assert.
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.
j9shr_getCacheDir() and SH_OSCache::getCacheDir() returns -1 on failure. I think the assert needs to be removed.
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 will remove this assert in the next 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.
PR: #5202
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.
Sorry, I thought it was still using j9shmem_getDir()
. I need to learn to read more carefully.
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.
You found a problem anyway :)
Add a new input parameter "allowVerbose" to SH_OSCache::getCacheDir() Always call SH_OSCache::getCacheDir() with allowVerbose = false in j9shr_getCacheDir(). related to eclipse-openj9#5134 and eclipse-openj9#5151 Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
failures.
according to the error code returned from j9shmem_getDir().
value instead of -1.
Fixes #5134
Signed-off-by: Hang Shao hangshao@ca.ibm.com