Search code examples
apache-karafkaraf

Karaf - running thread status after bundle restart


I'm using karaf 3.0.2. Let's suppose a bundle B (id 100) has launched some threads. What happens to these threads when I execute

karaf@root()> restart bundle 100

...when the running threads of bundle B are still active? Do these threads get terminated?


Solution

  • if you start threads in your OSGi bundle you need to take care of those threads. If you don't stop them yourself they keep on going. So make sure you stop those threads in the activator.

    To be precise, no those threads don't get terminated! You start them, you stop them.