Completion of DeploymentUnitProcessor.deploy(ear, war1, war2) observed in a subsequent phase?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Completion of DeploymentUnitProcessor.deploy(ear, war1, war2) observed in a subsequent phase?

Peter Palaga
Hi *,

I cannot find any info about what (if any) are the guarantees for
ordering and exit of DeploymentUnitProcessors (DUPs) in case of an EAR
that contains multiple WARs.

I have a situation like this: MyDUP1 is registered for Phase.PARSE and
MyDup2 is registered for Phase.DEPENDENCIES.
I can see from the logs that MyDUP1.deploy(ear),
MyDUP1.deploy(ear.war1), MyDUP1.deploy(war2), etc. are executed by
distinct threads which is perfectly OK.
I'd like to know if there is any guarantee that MyDup2.deploy(*)
observes the completion of MyDUP1.deploy(ear), MyDUP1.deploy(ear.war1),
MyDUP1.deploy(ear.war2), etc.?

MyDUP1.deploy() collects some info from the EAR and the WARs and stores
it as an attachment of the DeploymentUnit. MyDup2.deploy() is supposed
to read that attachment and so it is important that the info is complete
when MyDup2.deploy() reads it.

Thanks,

-- Peter
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Completion of DeploymentUnitProcessor.deploy(ear, war1, war2) observed in a subsequent phase?

Brian Stansberry
The DUPs in each Phase are executed in the start method of an MSC Service that represents that Phase for that deployment.[1] The start method executes the DUPs associated with the phase and then installs the service for the next phase.


On Tue, Sep 18, 2018 at 11:01 AM, Peter Palaga <[hidden email]> wrote:
Hi *,

I cannot find any info about what (if any) are the guarantees for
ordering and exit of DeploymentUnitProcessors (DUPs) in case of an EAR
that contains multiple WARs.

I have a situation like this: MyDUP1 is registered for Phase.PARSE and
MyDup2 is registered for Phase.DEPENDENCIES.
I can see from the logs that MyDUP1.deploy(ear),
MyDUP1.deploy(ear.war1), MyDUP1.deploy(war2), etc. are executed by
distinct threads which is perfectly OK.
I'd like to know if there is any guarantee that MyDup2.deploy(*)
observes the completion of MyDUP1.deploy(ear), MyDUP1.deploy(ear.war1),
MyDUP1.deploy(ear.war2), etc.?

MyDUP1.deploy() collects some info from the EAR and the WARs and stores
it as an attachment of the DeploymentUnit. MyDup2.deploy() is supposed
to read that attachment and so it is important that the info is complete
when MyDup2.deploy() reads it.

Thanks,

-- Peter
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



--
Brian Stansberry
Manager, Senior Principal Software Engineer
Red Hat

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Completion of DeploymentUnitProcessor.deploy(ear, war1, war2) observed in a subsequent phase?

Stuart Douglas
In reply to this post by Peter Palaga
For ear deployments each phase is first run for the ear, then run for all sub deployments in parallel. This means that any changes made by the ear deployer are visible, however you need to be careful about thread safety for the sub deployments if you are working with things attached to the top level ear, as multiple threads may be doing the same thing.

Stuart

On Wed, Sep 19, 2018 at 2:19 AM Peter Palaga <[hidden email]> wrote:
Hi *,

I cannot find any info about what (if any) are the guarantees for
ordering and exit of DeploymentUnitProcessors (DUPs) in case of an EAR
that contains multiple WARs.

I have a situation like this: MyDUP1 is registered for Phase.PARSE and
MyDup2 is registered for Phase.DEPENDENCIES.
I can see from the logs that MyDUP1.deploy(ear),
MyDUP1.deploy(ear.war1), MyDUP1.deploy(war2), etc. are executed by
distinct threads which is perfectly OK.
I'd like to know if there is any guarantee that MyDup2.deploy(*)
observes the completion of MyDUP1.deploy(ear), MyDUP1.deploy(ear.war1),
MyDUP1.deploy(ear.war2), etc.?

MyDUP1.deploy() collects some info from the EAR and the WARs and stores
it as an attachment of the DeploymentUnit. MyDup2.deploy() is supposed
to read that attachment and so it is important that the info is complete
when MyDup2.deploy() reads it.

Thanks,

-- Peter
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Completion of DeploymentUnitProcessor.deploy(ear, war1, war2) observed in a subsequent phase?

Peter Palaga
Very helpful, thanks a lot Brian and Stuart! -- P

On 18/09/18 23:41, Stuart Douglas wrote:

> For ear deployments each phase is first run for the ear, then run for
> all sub deployments in parallel. This means that any changes made by the
> ear deployer are visible, however you need to be careful about thread
> safety for the sub deployments if you are working with things attached
> to the top level ear, as multiple threads may be doing the same thing.
>
> Stuart
>
> On Wed, Sep 19, 2018 at 2:19 AM Peter Palaga <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi *,
>
>     I cannot find any info about what (if any) are the guarantees for
>     ordering and exit of DeploymentUnitProcessors (DUPs) in case of an EAR
>     that contains multiple WARs.
>
>     I have a situation like this: MyDUP1 is registered for Phase.PARSE and
>     MyDup2 is registered for Phase.DEPENDENCIES.
>     I can see from the logs that MyDUP1.deploy(ear),
>     MyDUP1.deploy(ear.war1), MyDUP1.deploy(war2), etc. are executed by
>     distinct threads which is perfectly OK.
>     I'd like to know if there is any guarantee that MyDup2.deploy(*)
>     observes the completion of MyDUP1.deploy(ear), MyDUP1.deploy(ear.war1),
>     MyDUP1.deploy(ear.war2), etc.?
>
>     MyDUP1.deploy() collects some info from the EAR and the WARs and stores
>     it as an attachment of the DeploymentUnit. MyDup2.deploy() is supposed
>     to read that attachment and so it is important that the info is
>     complete
>     when MyDup2.deploy() reads it.
>
>     Thanks,
>
>     -- Peter
>     _______________________________________________
>     wildfly-dev mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://lists.jboss.org/mailman/listinfo/wildfly-dev
>

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev