From c2c6e0b440274400ce6a1aaf9292cba31fba62ef Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 27 Aug 2021 12:01:10 -0400 Subject: [PATCH] Force the caller to run the bundle task if we are operating with <= 1 pool size --- .../uhn/fhir/jpa/dao/BaseTransactionProcessor.java | 13 +++++++++---- .../ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java index 3bcf236007b..fb66c22e0d5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseTransactionProcessor.java @@ -154,7 +154,7 @@ public abstract class BaseTransactionProcessor { private InMemoryResourceMatcher myInMemoryResourceMatcher; private ThreadPoolTaskExecutor myExecutor ; - + @VisibleForTesting public void setDaoConfig(DaoConfig theDaoConfig) { myDaoConfig = theDaoConfig; @@ -349,7 +349,12 @@ public abstract class BaseTransactionProcessor { for (int i=0; i { private CountDownLatch myCompletedLatch; - private ServletRequestDetails myRequestDetails; + private RequestDetails myRequestDetails; private IBase myNextReqEntry; private Map myResponseMap; private int myResponseOrder; @@ -1565,7 +1570,7 @@ public abstract class BaseTransactionProcessor { protected BundleTask(CountDownLatch theCompletedLatch, RequestDetails theRequestDetails, Map theResponseMap, int theResponseOrder, IBase theNextReqEntry, boolean theNestedMode) { this.myCompletedLatch = theCompletedLatch; - this.myRequestDetails = (ServletRequestDetails)theRequestDetails; + this.myRequestDetails = theRequestDetails; this.myNextReqEntry = theNextReqEntry; this.myResponseMap = theResponseMap; this.myResponseOrder = theResponseOrder; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java index a1b7bb0ae52..d5428cc9fd1 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4Test.java @@ -117,12 +117,16 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest { myDaoConfig.setAllowInlineMatchUrlReferences(false); myDaoConfig.setAllowMultipleDelete(new DaoConfig().isAllowMultipleDelete()); myModelConfig.setNormalizedQuantitySearchLevel(NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED); + myDaoConfig.setBundleBatchPoolSize(new DaoConfig().getBundleBatchPoolSize()); + myDaoConfig.setBundleBatchMaxPoolSize(new DaoConfig().getBundleBatchMaxPoolSize()); } @BeforeEach public void beforeDisableResultReuse() { myInterceptorRegistry.registerInterceptor(myInterceptor); myDaoConfig.setReuseCachedSearchResultsForMillis(null); + myDaoConfig.setBundleBatchPoolSize(1); + myDaoConfig.setBundleBatchMaxPoolSize(1); } private Bundle createInputTransactionWithPlaceholderIdInMatchUrl(HTTPVerb theVerb) {