diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java index b88e19c1df6..a4fe4de7562 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/config/BaseConfig.java @@ -404,7 +404,7 @@ public abstract class BaseConfig { @Bean(name= BatchConstants.JOB_LAUNCHING_TASK_EXECUTOR) public TaskExecutor jobLaunchingTaskExecutor() { - return ThreadPoolUtil.newThreadPool(0, 10, "JobLauncher-"); + return ThreadPoolUtil.newThreadPool(0, 10, "job-launcher-"); } @Bean diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java index 98cd99c287b..a543ba60867 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/util/ThreadPoolUtil.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.util; import ca.uhn.fhir.jpa.search.reindex.BlockPolicy; +import org.apache.commons.lang3.Validate; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import javax.annotation.Nonnull; @@ -12,6 +13,8 @@ public final class ThreadPoolUtil { @Nonnull public static ThreadPoolTaskExecutor newThreadPool(int theCorePoolSize, int theMaxPoolSize, String theThreadNamePrefix) { + Validate.matchesPattern(theThreadNamePrefix, "[a-z\\-]+", "Thread pool prefix name must consist only of lower-case letters and hyphens"); + Validate.isTrue(theThreadNamePrefix.endsWith("-"), "Thread pool prefix name must end with a hyphen"); ThreadPoolTaskExecutor asyncTaskExecutor = new ThreadPoolTaskExecutor(); asyncTaskExecutor.setCorePoolSize(theCorePoolSize); asyncTaskExecutor.setMaxPoolSize(theMaxPoolSize); diff --git a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java index c672713340a..28090b66939 100644 --- a/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java +++ b/hapi-fhir-validation/src/test/java/org/hl7/fhir/r4/validation/FhirInstanceValidatorR4Test.java @@ -1503,7 +1503,7 @@ public class FhirInstanceValidatorR4Test extends BaseTest { @Test public void testValidateBundleMultithreaded() throws IOException { // setup - StructureDefinition sd = loadStructureDefinition(myDefaultValidationSupport, "/r4/multithread/StructureDefinitionPatientV1.json"); + StructureDefinition sd = loadStructureDefinition(myDefaultValidationSupport, "/r4/concurrent-bundle/StructureDefinitionPatientV1.json"); myStructureDefinitionMap.put("https://example.com/StructureDefinition/Patient-v1", sd); @@ -1539,7 +1539,7 @@ public class FhirInstanceValidatorR4Test extends BaseTest { private Bundle buildBundle(int theSize, boolean theValidBundle) throws IOException { BundleBuilder bundleBuilder = new BundleBuilder(ourCtx); - Patient p = ourCtx.newJsonParser().parseResource(Patient.class, loadResource("/r4/multithread/patient.json")); + Patient p = ourCtx.newJsonParser().parseResource(Patient.class, loadResource("/r4/concurrent-bundle/patient.json")); for (int i = 0; i < theSize; ++i) { bundleBuilder.addTransactionCreateEntry(p); } diff --git a/hapi-fhir-validation/src/test/resources/r4/multithread/StructureDefinitionPatientV1.json b/hapi-fhir-validation/src/test/resources/r4/concurrent-bundle/StructureDefinitionPatientV1.json similarity index 100% rename from hapi-fhir-validation/src/test/resources/r4/multithread/StructureDefinitionPatientV1.json rename to hapi-fhir-validation/src/test/resources/r4/concurrent-bundle/StructureDefinitionPatientV1.json diff --git a/hapi-fhir-validation/src/test/resources/r4/multithread/patient.json b/hapi-fhir-validation/src/test/resources/r4/concurrent-bundle/patient.json similarity index 100% rename from hapi-fhir-validation/src/test/resources/r4/multithread/patient.json rename to hapi-fhir-validation/src/test/resources/r4/concurrent-bundle/patient.json