[jboss-jira] [JBoss JIRA] (WFCORE-3948) Potential race condition on deployment of EAR when Class-Path manifest entry is in use

Scott Marlow (Jira) issues at jboss.org
Tue Sep 24 21:33:00 EDT 2019


    [ https://issues.jboss.org/browse/WFCORE-3948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788718#comment-13788718 ] 

Scott Marlow commented on WFCORE-3948:
--------------------------------------

Assuming that ManifestClassPathProcessor, ManifestDependencyProcessor and DeploymentStructureDescriptorParser are running during the STRUCTURE phase, because they have to.  If we introduced a STRUCTURE2 phase, we could expect ADDITIONAL_MODULES writing is done during the (first) STRUCTURE phase and by the time we reach the second STRUCTURE2 phase, it is safe to read the ADDITIONAL_MODULES.  At least this could be a goal, that we could see if we could reach.  

Another high level idea, since the ManifestClassPathProcessor.deploy() is already synchronized, if ManifestDependencyProcessor.deploy() and DeploymentStructureDescriptorParser.deploy() were made to also synchronize on the same object, we would slow deployment time but I think wouldn't see the ConcurrentModificationException any more.  

Or slightly better performing idea, could be to use a ReadWriteLock, where ManifestClassPathProcessor, ManifestDependencyProcessor and DeploymentStructureDescriptorParser  code that reads ADDITIONAL_MODULES, waits on a shared read lock and writes to ADDITIONAL_MODULES waits on an exclusive write lock.

> Potential race condition on deployment of EAR when Class-Path manifest entry is in use
> --------------------------------------------------------------------------------------
>
>                 Key: WFCORE-3948
>                 URL: https://issues.jboss.org/browse/WFCORE-3948
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Server
>            Reporter: Stuart Douglas
>            Priority: Major
>
> Attachments#ADDITIONAL_MODULES is attached to the top level DU, but modified by sub deployments in ManifestClassPathProcessor#createAdditionalModule without any sort of synchronisation. This can result in ConcurrentModificationException when the list is read/written to by other sub deployments at the same time.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list