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

Shutdown Karaf but the bundle stop is not follow the start-level

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.0
    • Fix Version/s: None
    • Component/s: karaf-shell
    • Labels:
      None
    • Environment:

      linux or win7

      Description

      I set a bundle start level to bundles as this:
      Name Level
      bundle-a 81
      bundle-b 82
      bundle-c 83
      When I use osgi:start-level 80, bundles closed as order 83,82,81 and this is what I expected.
      When I use shutdown, bundles closed as order 81,83,82 and this tis not what I expected.
      Could you make the bundles stop follow the reverse order of start level when karaf shutdown

        Issue Links

          Activity

          Hide
          gnt Guillaume Nodet added a comment -

          Looking at the code, that's really what is supposed to happen when shutting down the osgi framework. It's just calling setActiveStartLevel(0) and should have the correct behavior.

          Show
          gnt Guillaume Nodet added a comment - Looking at the code, that's really what is supposed to happen when shutting down the osgi framework. It's just calling setActiveStartLevel(0) and should have the correct behavior.
          Hide
          lkyooo Bill Lang added a comment -

          Well, We see code of org.apache.karaf.shell.osgi.Shutdown.java
          it uses these codes to stop karaf
          Bundle bundle = getBundleContext().getBundle(0);
          bundle.stop();
          it did not calling setActiveStartLevel(0) before karaf shutdown and stop system bundle, so could you check the code?

          Show
          lkyooo Bill Lang added a comment - Well, We see code of org.apache.karaf.shell.osgi.Shutdown.java it uses these codes to stop karaf Bundle bundle = getBundleContext().getBundle(0); bundle.stop(); it did not calling setActiveStartLevel(0) before karaf shutdown and stop system bundle, so could you check the code?
          Hide
          geerzo Chris Geer added a comment -

          I'm seeing the exact same thing. I agree calling setActiveStartLevel(0) is exactly what should happen but as Bill stated, I'm not seeing that is actually what is happening.

          http://karaf.922171.n3.nabble.com/Shutdown-Order-on-2-3-3-td4031709.html

          Show
          geerzo Chris Geer added a comment - I'm seeing the exact same thing. I agree calling setActiveStartLevel(0) is exactly what should happen but as Bill stated, I'm not seeing that is actually what is happening. http://karaf.922171.n3.nabble.com/Shutdown-Order-on-2-3-3-td4031709.html
          Hide
          pan4o Peter Radomski added a comment -

          i think we have the same problem with the 2.3.2 karaf version. The stop order is undefined ...

          Show
          pan4o Peter Radomski added a comment - i think we have the same problem with the 2.3.2 karaf version. The stop order is undefined ...
          Hide
          gnt Guillaume Nodet added a comment -

          The bundles are actually stopped in the correct order I think.
          However, blueprint intercepts the fact that the framework is shutting down and preemptively shutdown blueprint containers in a different order.
          The order is supposed to minimize disruption by shutting down blueprint containers that uses services before those that expose services.
          See KARAF-2803

          Show
          gnt Guillaume Nodet added a comment - The bundles are actually stopped in the correct order I think. However, blueprint intercepts the fact that the framework is shutting down and preemptively shutdown blueprint containers in a different order. The order is supposed to minimize disruption by shutting down blueprint containers that uses services before those that expose services. See KARAF-2803

            People

            • Assignee:
              Unassigned
              Reporter:
              lkyooo Bill Lang
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Development