Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-4016

NodeImpl startComposite forgets about a composite if there is a failure on start

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java-SCA-2.0-Beta3
    • Java-SCA-2.0
    • SCA Java Runtime
    • None
    • All

    Description

      org.apache.tuscany.sca.impl.NodeImpl does the following on start

      public void startComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException, ContributionReadException {
      String key = contributionURI+"/"+compositeURI;
      if (startedComposites.containsKey(key))

      { throw new IllegalStateException("composite already started: " + compositeURI); }

      DeployedComposite dc = stoppedComposites.remove(key);
      if (dc != null) {
      dc.start();
      startedComposites.put(key, dc);

      and the following on stop

      String key = contributionURI+"/"+compositeURI;
      DeployedComposite dc = startedComposites.remove(key);
      if (dc != null)

      { dc.stop(); stoppedComposites.put(key, dc); }

      else {

      If an error is thrown on start it won't be in startedComposites but some of the providers may have been started. So even in the failure case we should consider the composite partially started so that it can be stopped correctly.

      Attachments

        Activity

          People

            simonslaws Simon Laws
            simonslaws Simon Laws
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: