Source:
<code>public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); WeldCapability weldCapability; try { weldCapability = support.getCapabilityRuntimeAPI(Capabilities.WELD_CAPABILITY_NAME, WeldCapability.class); } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw MicroProfileFaultToleranceLogger.ROOT_LOGGER.deploymentRequiresCapability(deploymentUnit.getName(), WELD_CAPABILITY_NAME); } if (weldCapability.isPartOfWeldDeployment(deploymentUnit)) { weldCapability.registerExtensionInstance(new MicroProfileFaultToleranceCDIExtension(), deploymentUnit); } synchronized (remainingHystrixConfiguringDeployments) { <START> if (remainingHystrixConfiguringDeployments.get() == 0) { <END> Module module = deploymentUnit.getAttachment(Attachments.MODULE); Config mpConfig = ConfigProvider.getConfig(module.getClassLoader()); AbstractConfiguration configInstance = ConfigurationManager.getConfigInstance(); boolean isHystrixConfiguringDeployment = false; for (String key : mpConfig.getPropertyNames()) { if (key.startsWith("hystrix.")) { String value = mpConfig.getValue(key, String.class); MicroProfileFaultToleranceLogger.ROOT_LOGGER.debugf("Configuring Hystrix: %s=%s", key, value); configInstance.setProperty(key, value); isHystrixConfiguringDeployment = true; } } if (isHystrixConfiguringDeployment) { deploymentUnit.putAttachment(ATTACHMENT_KEY, Boolean.TRUE); remainingHystrixConfiguringDeployments.incrementAndGet(); } } else { MicroProfileFaultToleranceLogger.ROOT_LOGGER.hystrixAlreadyConfigured(deploymentUnit.getName()); } } }</code><technical_language>This is racy. thread reaching this block compete a undeploy thread set remainingHystrixConfiguringDeployments counter 0. This result undeploy thread clearing configuration a deploy thread created</technical_language>

Target:
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!MicroProfileFaultToleranceMarker.isMarked(deploymentUnit)) { return; } CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); WeldCapability weldCapability; try { weldCapability = support.getCapabilityRuntimeAPI(Capabilities.WELD_CAPABILITY_NAME, WeldCapability.class); } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw new IllegalStateException(); } weldCapability.registerExtensionInstance(new MicroProfileFaultToleranceCDIExtension(), deploymentUnit); weldCapability.registerExtensionInstance(new HystrixExtension(), deploymentUnit); synchronized (this) { if (remainingHystrixConfiguringDeployments == 0) { Module module = deploymentUnit.getAttachment(Attachments.MODULE); Config mpConfig = ConfigProvider.getConfig(module.getClassLoader()); boolean isHystrixConfiguringDeployment = false; for (String key : mpConfig.getPropertyNames()) { if (key.startsWith("hystrix.")) { String value = mpConfig.getValue(key, String.class); MicroProfileFaultToleranceLogger.ROOT_LOGGER.debugf("Configuring Hystrix: %s=%s", key, value); configInstance.setProperty(key, value); isHystrixConfiguringDeployment = true; } } if (isHystrixConfiguringDeployment) { deploymentUnit.putAttachment(ATTACHMENT_KEY, Boolean.TRUE); remainingHystrixConfiguringDeployments++; } } else { MicroProfileFaultToleranceLogger.ROOT_LOGGER.hystrixAlreadyConfigured(deploymentUnit.getName()); } } }