Uploaded image for project: 'Stratos'
  1. Stratos
  2. STRATOS-1565

Fix registry transactions exception handling

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.3
    • Component/s: None
    • Labels:
      None

      Description

      When performing Registry transactions, "beginTransaction" and "commitTransaction" methods should always be in a try block and RegistryException should be caught and rolled back by calling "rollbackTransaction" method. "rollbackTransaction" should also be in another try block and rollback exception should be properly logged.

      For eg:

      try

      { registryService.beginTransaction(); registryService.delete(resourcePath); registryService.commitTransaction(); }

      catch (RegistryException e) {
      try

      { registryService.rollbackTransaction(); }

      catch (RegistryException e1) {
      if (log.isErrorEnabled())

      { log.error("Could not rollback transaction", e1); }

      }
      String message = "Could not delete resource at " + resourcePath;
      throw new AutoScalerException(message, e);
      }

      Buggy registry operations could result in unreleased locks.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ravihansa Akila Perera
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: