Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2221

The admin service is not safe when used to create / start agents quickly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 3.0.0
    • Fix Version/s: 2.3.2, 2.4.0, 3.0.0
    • Component/s: None
    • Labels:
      None

      Description

      That's because when starting, karaf instances write to the file and the admin service may also write to the file at the same time resulting in data loss.

      An easy way to replicate the problem is the following:

      > each [ 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 ] { echo "Creating test$it"; admin:create "test$it" ; admin:list ; echo "Start test$it" ; admin:start "test$it" ; admin:list }
      

      It most certainly looses instances before the end.

        Activity

        Hide
        gnt Guillaume Nodet added a comment -

        Fixed on 2.3.x branch with http://svn.apache.org/r1452894

        Show
        gnt Guillaume Nodet added a comment - Fixed on 2.3.x branch with http://svn.apache.org/r1452894
        Hide
        chris@die-schneider.net Christian Schneider added a comment -

        Your change seems to break 2 tests in core and command. I fixed the one in core. Can you have a look at the one in command?

        Show
        chris@die-schneider.net Christian Schneider added a comment - Your change seems to break 2 tests in core and command. I fixed the one in core. Can you have a look at the one in command?
        Hide
        gnt Guillaume Nodet added a comment -

        Ported to trunk

        Committing to https://svn.apache.org/repos/asf/karaf/trunk ...
        A util/src/main/java/org/apache/karaf/util/properties/FileLockUtils.java
        M instance/command/src/main/java/org/apache/karaf/instance/main/Execute.java
        M instance/command/src/test/java/org/apache/karaf/instance/main/ExecuteTest.java
        M instance/core/pom.xml
        M instance/core/src/main/java/org/apache/karaf/instance/core/Instance.java
        M instance/core/src/main/java/org/apache/karaf/instance/core/InstanceService.java
        M instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceImpl.java
        M instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
        M instance/core/src/main/resources/OSGI-INF/blueprint/instance-core.xml
        M main/pom.xml
        M main/src/main/java/org/apache/karaf/main/InstanceHelper.java
        M pom.xml
        M util/pom.xml
        Committed r1455901

        Show
        gnt Guillaume Nodet added a comment - Ported to trunk Committing to https://svn.apache.org/repos/asf/karaf/trunk ... A util/src/main/java/org/apache/karaf/util/properties/FileLockUtils.java M instance/command/src/main/java/org/apache/karaf/instance/main/Execute.java M instance/command/src/test/java/org/apache/karaf/instance/main/ExecuteTest.java M instance/core/pom.xml M instance/core/src/main/java/org/apache/karaf/instance/core/Instance.java M instance/core/src/main/java/org/apache/karaf/instance/core/InstanceService.java M instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceImpl.java M instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java M instance/core/src/main/resources/OSGI-INF/blueprint/instance-core.xml M main/pom.xml M main/src/main/java/org/apache/karaf/main/InstanceHelper.java M pom.xml M util/pom.xml Committed r1455901

          People

          • Assignee:
            gnt Guillaume Nodet
            Reporter:
            gnt Guillaume Nodet
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development