Petals Ant Tasks

'jbi-deploy-service-assembly' does not fail when an error occurs during the deployment

Details

  • Description:
    Hide

    If the deployment of a service assembly succeeds on the container side, returning a deployment report with errors at service-unit level, the Petals Ant Task jbi-deploy-service-assembly does not fail even if the attribute failOnError is set to true.
    Only the error is logged on the Ant task side:

    [jbi-deploy-service-assembly] Failed to deploy SU 'su-xslt-two-provides-5.0.0-SNAPSHOT':
    [jbi-deploy-service-assembly] org.ow2.petals.component.framework.api.exception.PEtALSCDKException: Only one 'Provides' section is allowed by this component.
    [jbi-deploy-service-assembly] 	at org.ow2.petals.se.xslt.XsltSuManager.doDeploy(XsltSuManager.java:132)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.component.framework.su.AbstractServiceUnitManager.deploy(AbstractServiceUnitManager.java:266)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeploySUToComponentTask.deploySUtoComponent(DeploySUToComponentTask.java:122)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeploySUToComponentTask.execute(DeploySUToComponentTask.java:75)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.api.jbi.management.TaskProcessor.process(TaskProcessor.java:73)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeployAllSUTask.registerAndDeploySU(DeployAllSUTask.java:165)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeployAllSUTask.deploySUS(DeployAllSUTask.java:122)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeployAllSUTask.execute(DeployAllSUTask.java:81)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.api.jbi.management.TaskProcessor.process(TaskProcessor.java:73)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.deployment.DeploymentServiceImpl.deploy(DeploymentServiceImpl.java:169)
    ...
    ...
    ...
    [jbi-deploy-service-assembly] Service assembly 'sa-xslt-undeployable-su-5.0.0-SNAPSHOT' deployed with some SU deployment in failure
    Show
    If the deployment of a service assembly succeeds on the container side, returning a deployment report with errors at service-unit level, the Petals Ant Task jbi-deploy-service-assembly does not fail even if the attribute failOnError is set to true. Only the error is logged on the Ant task side:
    [jbi-deploy-service-assembly] Failed to deploy SU 'su-xslt-two-provides-5.0.0-SNAPSHOT':
    [jbi-deploy-service-assembly] org.ow2.petals.component.framework.api.exception.PEtALSCDKException: Only one 'Provides' section is allowed by this component.
    [jbi-deploy-service-assembly] 	at org.ow2.petals.se.xslt.XsltSuManager.doDeploy(XsltSuManager.java:132)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.component.framework.su.AbstractServiceUnitManager.deploy(AbstractServiceUnitManager.java:266)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeploySUToComponentTask.deploySUtoComponent(DeploySUToComponentTask.java:122)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeploySUToComponentTask.execute(DeploySUToComponentTask.java:75)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.api.jbi.management.TaskProcessor.process(TaskProcessor.java:73)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeployAllSUTask.registerAndDeploySU(DeployAllSUTask.java:165)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeployAllSUTask.deploySUS(DeployAllSUTask.java:122)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.task.deployment.deploy.DeployAllSUTask.execute(DeployAllSUTask.java:81)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.api.jbi.management.TaskProcessor.process(TaskProcessor.java:73)
    [jbi-deploy-service-assembly] 	at org.ow2.petals.microkernel.jbi.management.deployment.DeploymentServiceImpl.deploy(DeploymentServiceImpl.java:169)
    ...
    ...
    ...
    [jbi-deploy-service-assembly] Service assembly 'sa-xslt-undeployable-su-5.0.0-SNAPSHOT' deployed with some SU deployment in failure
  • Environment:
    -

Issue Links

Activity

Hide
Christophe DENEUX added a comment - Thu, 26 Mar 2015 - 10:44:54 +0100

An integration test about this problem has been added with svn#37046

Show
Christophe DENEUX added a comment - Thu, 26 Mar 2015 - 10:44:54 +0100 An integration test about this problem has been added with svn#37046
Hide
Christophe DENEUX added a comment - Thu, 26 Mar 2015 - 11:57:03 +0100

On the model of DeploymentServiceMBean, we think that the Petals Ant task jbi-deploy-service-assembly:

  • must fail on an error of the implementation’s execution of the task (ie. the tag frmwk-task-result/frmwk-task-result-details/task-result-details/task-result of the deployment report is FAILED) according to the value of the attribute failOnError,
  • must not fail on an error of interaction(s) with a component (ie. the tag component-task-result/component-task-result-details/task-result-details/task-result of the deployment report is FAILED) except if a new attribute failOnComponentError is set to true.

The default value of failOnComponentError is false to be aligned on the processing of DeploymentServiceMBean.

When failOnComponentError is set to true, if failOnError is set to false, the Petals Ant task will not fail.

Show
Christophe DENEUX added a comment - Thu, 26 Mar 2015 - 11:57:03 +0100 On the model of DeploymentServiceMBean, we think that the Petals Ant task jbi-deploy-service-assembly:
  • must fail on an error of the implementation’s execution of the task (ie. the tag frmwk-task-result/frmwk-task-result-details/task-result-details/task-result of the deployment report is FAILED) according to the value of the attribute failOnError,
  • must not fail on an error of interaction(s) with a component (ie. the tag component-task-result/component-task-result-details/task-result-details/task-result of the deployment report is FAILED) except if a new attribute failOnComponentError is set to true.
The default value of failOnComponentError is false to be aligned on the processing of DeploymentServiceMBean. When failOnComponentError is set to true, if failOnError is set to false, the Petals Ant task will not fail.
Hide
Christophe DENEUX added a comment - Thu, 26 Mar 2015 - 15:55:46 +0100

Fixed in trunk

Show
Christophe DENEUX added a comment - Thu, 26 Mar 2015 - 15:55:46 +0100 Fixed in trunk
Hide
Victor NOËL added a comment - Thu, 26 Mar 2015 - 17:45:21 +0100

I'm not totally happy with the fix: now this task is the ONLY one that throws an exception (and thus failOnError) when something is going wrong.

And actually, if the SA fails to deploy (the last else in the code) no exception is thrown (and thus the failOnError is not used).

The same happens for every task! And the jbi-start-service-assembly task has not the same structure as the deploy even though starting an SU could fail...

I think failOnError was there to fail when an error OTHER than a failing of the actual business task happened.

Anyway, we must fix that in a coherent way or not touch it...

Show
Victor NOËL added a comment - Thu, 26 Mar 2015 - 17:45:21 +0100 I'm not totally happy with the fix: now this task is the ONLY one that throws an exception (and thus failOnError) when something is going wrong. And actually, if the SA fails to deploy (the last else in the code) no exception is thrown (and thus the failOnError is not used). The same happens for every task! And the jbi-start-service-assembly task has not the same structure as the deploy even though starting an SU could fail... I think failOnError was there to fail when an error OTHER than a failing of the actual business task happened. Anyway, we must fix that in a coherent way or not touch it...
Hide
Christophe DENEUX added a comment - Fri, 27 Mar 2015 - 09:19:02 +0100

Yes and no !

You're right when telling that, according to the source code of the Ant task, if the SA fails to deploy (the last else in the code) no exception is throw. But when saying "the SA fails to deploy", you must tell the difference between:

  1. the implementation’s execution of the task DeploymentServiceMBean.deploy(),
  2. and, the interaction(s) with a component during DeploymentServiceMBean.deploy()

Moreover, according to the §6.6 of JBI specifications:

The package must conform to the requirements detailed in the section on “Service Assembly Packaging”, else the deployment MUST fail (by throwing a java.lang.Exception) without attempting to deploy any of the service units contained within the assembly.
...
If all service units of the assembly fail to deploy, a failure exception MUST be thrown. If at least one service unit deployment succeeds, then any failures MUST be reported using the status return String of the DeploymentServiceMBeans’s deploy() method.

So, I see no case where we can have a deployment report where the part linked to the implementation’s execution of the task has a status FAILED because an exception is thrown by DeploymentServiceMBean.deploy(). And so, I think that the last statement else in the code is a dead code part. In doubt, I don't remove it.

I will check the container source code about the possibility to have a deployment report with a status FAILED in the part of the implementation’s execution of the task DeploymentServiceMBean.deploy().

Show
Christophe DENEUX added a comment - Fri, 27 Mar 2015 - 09:19:02 +0100 Yes and no ! You're right when telling that, according to the source code of the Ant task, if the SA fails to deploy (the last else in the code) no exception is throw. But when saying "the SA fails to deploy", you must tell the difference between:
  1. the implementation’s execution of the task DeploymentServiceMBean.deploy(),
  2. and, the interaction(s) with a component during DeploymentServiceMBean.deploy()
Moreover, according to the §6.6 of JBI specifications:
The package must conform to the requirements detailed in the section on “Service Assembly Packaging”, else the deployment MUST fail (by throwing a java.lang.Exception) without attempting to deploy any of the service units contained within the assembly. ... If all service units of the assembly fail to deploy, a failure exception MUST be thrown. If at least one service unit deployment succeeds, then any failures MUST be reported using the status return String of the DeploymentServiceMBeans’s deploy() method.
So, I see no case where we can have a deployment report where the part linked to the implementation’s execution of the task has a status FAILED because an exception is thrown by DeploymentServiceMBean.deploy(). And so, I think that the last statement else in the code is a dead code part. In doubt, I don't remove it. I will check the container source code about the possibility to have a deployment report with a status FAILED in the part of the implementation’s execution of the task DeploymentServiceMBean.deploy().
Hide
Christophe DENEUX added a comment - Fri, 27 Mar 2015 - 09:33:10 +0100

According to the container source code (svn#37049) , no deployment report can be generated with a status FAILED in the part of the implementation’s execution of the task DeploymentServiceMBean.deploy().

Show
Christophe DENEUX added a comment - Fri, 27 Mar 2015 - 09:33:10 +0100 According to the container source code (svn#37049) , no deployment report can be generated with a status FAILED in the part of the implementation’s execution of the task DeploymentServiceMBean.deploy().
Hide
Victor NOËL added a comment - Fri, 27 Mar 2015 - 11:58:04 +0100

Ok, I better understand, so at least we should maybe generalise the failOnComponentError to other task?

Show
Victor NOËL added a comment - Fri, 27 Mar 2015 - 11:58:04 +0100 Ok, I better understand, so at least we should maybe generalise the failOnComponentError to other task?
Hide
Christophe DENEUX added a comment - Mon, 5 Oct 2015 - 10:51:45 +0200 - edited

Generalization will be done through PETALSANT-25

Show
Christophe DENEUX added a comment - Mon, 5 Oct 2015 - 10:51:45 +0200 - edited Generalization will be done through PETALSANT-25

People

Dates

  • Created:
    Thu, 26 Mar 2015 - 10:39:55 +0100
    Updated:
    Mon, 12 Sep 2016 - 17:06:35 +0200
    Resolved:
    Mon, 12 Sep 2016 - 17:06:35 +0200