@@ -567,6 +567,7 @@ SH_CacheMap::startup(J9VMThread* currentThread, J9SharedClassPreinitConfig* pico
567
567
}
568
568
if (0 == _sharedClassConfig->readOnlyCacheRuntimeFlags ) {
569
569
_sharedClassConfig->readOnlyCacheRuntimeFlags = (_sharedClassConfig->runtimeFlags | J9SHR_RUNTIMEFLAG_ENABLE_READONLY);
570
+ _sharedClassConfig->readOnlyCacheRuntimeFlags &= ~J9SHR_RUNTIMEFLAG_AUTOKILL_DIFF_BUILDID;
570
571
_readOnlyCacheRuntimeFlags = &_sharedClassConfig->readOnlyCacheRuntimeFlags ;
571
572
}
572
573
I_8 preLayer = 0 ;
@@ -595,7 +596,7 @@ SH_CacheMap::startup(J9VMThread* currentThread, J9SharedClassPreinitConfig* pico
595
596
if (isCcHead) {
596
597
cacheFileSize = _ccHead->getTotalSize ();
597
598
}
598
- handleStartupError (currentThread, ccToUse, rc, *runtimeFlags, _verboseFlags, &doRetry);
599
+ handleStartupError (currentThread, ccToUse, rc, *runtimeFlags, _verboseFlags, &doRetry, &deleteRC );
599
600
600
601
if (isCcHead && doRetry) {
601
602
if (cacheFileSize > 0 ) {
@@ -690,7 +691,7 @@ SH_CacheMap::startup(J9VMThread* currentThread, J9SharedClassPreinitConfig* pico
690
691
} while (NULL != ccToUse && CC_STARTUP_OK == rc);
691
692
692
693
if (rc != CC_STARTUP_OK) {
693
- handleStartupError (currentThread, ccToUse, rc, *runtimeFlags, _verboseFlags, &doRetry);
694
+ handleStartupError (currentThread, ccToUse, rc, *runtimeFlags, _verboseFlags, &doRetry, &deleteRC );
694
695
Trc_SHR_CM_startup_Exit1 (currentThread);
695
696
return -1 ;
696
697
}
@@ -779,9 +780,10 @@ SH_CacheMap::startup(J9VMThread* currentThread, J9SharedClassPreinitConfig* pico
779
780
* @param [in] runtimeFlags The runtime flags
780
781
* @param [in] verboseFlags Flags controlling the verbose output
781
782
* @param [out] doRetry Whether to retry starting up the cache
783
+ * @param [out] deleteRC 0 if cache is successful deleted, -1 otherwise.
782
784
*/
783
785
void
784
- SH_CacheMap::handleStartupError (J9VMThread* currentThread, SH_CompositeCacheImpl* ccToUse, IDATA errorCode, U_64 runtimeFlags, UDATA verboseFlags, bool *doRetry)
786
+ SH_CacheMap::handleStartupError (J9VMThread* currentThread, SH_CompositeCacheImpl* ccToUse, IDATA errorCode, U_64 runtimeFlags, UDATA verboseFlags, bool *doRetry, IDATA *deleteRC )
785
787
{
786
788
PORT_ACCESS_FROM_VMC (currentThread);
787
789
if (errorCode == CC_STARTUP_CORRUPT) {
@@ -802,9 +804,9 @@ SH_CacheMap::handleStartupError(J9VMThread* currentThread, SH_CompositeCacheImpl
802
804
if ((errorCode == CC_STARTUP_CORRUPT) || (errorCode == CC_STARTUP_RESET) || (errorCode == CC_STARTUP_SOFT_RESET)) {
803
805
/* If SOFT_RESET, suppress verbose unless "verbose" is explicitly set
804
806
* This will ensure that if the VM can't destroy the cache, we don't get unwanted error messages */
805
- IDATA deleteRC = ccToUse->deleteCache (currentThread, (errorCode == CC_STARTUP_SOFT_RESET) && !(verboseFlags & J9SHR_VERBOSEFLAG_ENABLE_VERBOSE));
807
+ * deleteRC = ccToUse->deleteCache (currentThread, (errorCode == CC_STARTUP_SOFT_RESET) && !(verboseFlags & J9SHR_VERBOSEFLAG_ENABLE_VERBOSE));
806
808
ccToUse->cleanup (currentThread);
807
- if (deleteRC == 0 ) {
809
+ if (0 == *deleteRC ) {
808
810
if (errorCode == CC_STARTUP_CORRUPT) {
809
811
/* Recovering from a corrupted cache, clear the flags which prevent access */
810
812
resetCorruptState (currentThread, FALSE );
@@ -814,7 +816,7 @@ SH_CacheMap::handleStartupError(J9VMThread* currentThread, SH_CompositeCacheImpl
814
816
/* If the restored cache is corrupted, return CC_STARTUP_CORRUPT and do not retry,
815
817
* as retry will create another empty cache that is not restored from the snapshot
816
818
*/
817
- if ((deleteRC == 0 ) || (errorCode == CC_STARTUP_SOFT_RESET)) {
819
+ if ((0 == *deleteRC ) || (errorCode == CC_STARTUP_SOFT_RESET)) {
818
820
/* If we deleted the cache, or in the case of SOFT_RESET, even if we failed to delete the cache, retry */
819
821
Trc_SHR_Assert_True (ccToUse == _ccHead);
820
822
*doRetry = true ;
0 commit comments