Skip to content

mySystemRequestDetails not initialized in BaseResourceCacheSynchronizer when booting MDM with Partitions #6948

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,20 @@ public void registerListener() {
ourLog.info("No resource DAO found for resource type {}, not registering listener", myResourceName);
return;
}
mySystemRequestDetails = SystemRequestDetails.forAllPartitions();
initializeRequestDetails();

IResourceChangeListenerCache resourceCache =
myResourceChangeListenerRegistry.registerResourceResourceChangeListener(
myResourceName, provideSearchParameterMap(), this, REFRESH_INTERVAL);
resourceCache.forceRefresh();
}

private void initializeRequestDetails() {
if (mySystemRequestDetails == null) {
mySystemRequestDetails = SystemRequestDetails.forAllPartitions();
}
}

private SearchParameterMap provideSearchParameterMap() {
SearchParameterMap searchParameterMap = mySearchParameterMap;
if (searchParameterMap == null) {
Expand Down Expand Up @@ -178,6 +184,7 @@ public int doSyncResourcesForUnitTest() {
}

synchronized int doSyncResourcesWithRetry() {
initializeRequestDetails();
// retry runs MAX_RETRIES times
// and if errors result every time, it will fail
Retrier<Integer> syncResourceRetrier = new Retrier<>(this::doSyncResources, getMaxRetries());
Expand Down