This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[Copied from users@mdr] I seem to be getting a thread leak when using MDR in my Ant task. I am trying to understand how MDRepository.shutdown() causes the event dispatching thread to stop. I can't see anything in the MDR source code that would stop the thread. I changed the code that creates the thread so that it labels it "MDR event dispatcher" and then ran the code in the debugger. Even after repository.shutdown() has been called, the "MDR event dispatcher" thread is still in "Wait" state. This is really obvious when running my ant task inside the IDE because the "Execution View" tab in the IDE doesn't remove the Ant process from the list after it is done executing.
Created attachment 8283 [details] proposed (incomplete) patch for demonstration purposes only
The patch I just attached makes kills the thread when the repository is shutdown. Without the patch, the event dispatching thread remains in "wait" state after the repository is shut down. I thought that this fix was going to require a lot more work but actually it might do the job all by itself if try/finally blocks were added in MdrStorage.shutdown() (to make sure that the thread is stopped regardless of any errors encountered beforehand) and in NBMDRepositoryImpl.shutdown() (to set mdrStorage = null even if an execption occurred in mdrStorage.shutdown()).
Patch integrated. Thanks!
quiet for too long, verified