Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364224

Summary: [console] Refreshing bundles results in continual creation of GoGo shell daemon threads.
Product: [Eclipse Project] Equinox Reporter: John Ross <jwross>
Component: ComponentsAssignee: equinox.components-inbox <equinox.components-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: l.kirchev, tjwatson
Version: 3.8.0 Juno   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description John Ross CLA 2011-11-19 12:20:44 EST
Refreshing bundles using FrameworkWiring results in the creation of a new GoGo shell daemon thread, and the previous one is not cleaned up. This will eventually result in an OutOfMemory error.

To reproduce, just write an Activator with something like the following.

public void start(final BundleContext context) throws Exception {
  thread = new Thread(new Runnable() {
    public void run() {
      Collection<Bundle> bundles = Arrays.asList(context.getBundles());
      FrameworkWiring wiring = context.getBundle(0).adapt(
        FrameworkWiring.class);
      while (!Thread.currentThread().isInterrupted()) {
        try {
          Thread.sleep(1000);
          wiring.refreshBundles(bundles);
        }
        catch (InterruptedException e) {
          break;
        }
        catch (Throwable t) {
          t.printStackTrace();
        }
      }
    }
  });
  thread.setDaemon(true);
  thread.start();
}
Comment 1 Thomas Watson CLA 2011-11-21 14:27:35 EST
Hmmm, refreshing every single bundle installed, that sounds like a recipe for disaster ;-)
Comment 2 John Ross CLA 2011-11-21 14:53:35 EST
(In reply to comment #1)
> Hmmm, refreshing every single bundle installed, that sounds like a recipe for
> disaster ;-)

And indeed it was :) But that shouldn't prohibit cleaning up obsolete threads, should it? All that's really happening is the GoGo shell bundle is being stopped and started as part of each refresh. The same issue might be there when refreshing only the GoGo shell bundle, although I did not try this.
Comment 3 Lazar Kirchev CLA 2011-11-22 01:39:47 EST
(In reply to comment #2)
> (In reply to comment #1)
> > Hmmm, refreshing every single bundle installed, that sounds like a recipe for
> > disaster ;-)
> 
> And indeed it was :) But that shouldn't prohibit cleaning up obsolete threads,
> should it? All that's really happening is the GoGo shell bundle is being
> stopped and started as part of each refresh. The same issue might be there when
> refreshing only the GoGo shell bundle, although I did not try this.

Yes, you are right - I also think this should happen even if only the shell is refreshed. I will see how to fix this.
Comment 4 Lazar Kirchev CLA 2013-04-14 12:32:42 EDT
The problem is in the Gogo code, opened bug https://issues.apache.org/jira/browse/FELIX-4024
Comment 5 Eclipse Genie CLA 2019-10-28 20:13:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.