Community
Participate
Working Groups
Build ID: 3.5 Steps To Reproduce: 1. See attached repo case. More information: When querying a bundle for resources after restarting an Equinox instance the MRUBundleFileList causes an ISE when accessing its EventManager which was closed when the framework was previously shutdown and then was never reopened. Enough bundles need to be opened for the MRU cache to run out of space before the problem shows. A workaround is to disable the MRU cache. A better solution is not to use a static for the MRUBundleFileList, or at least to reopen this static when the framework is started again. This also means that an EventManager needs to be restartable. Tom - I'm happy to patch this up if you have a solution that you prefer.
Created attachment 117107 [details] repo case
(In reply to comment #0) > Tom - I'm happy to patch this up if you have a solution that you prefer. > Sure, you can have this one Rob!! I prefer the approach to get rid of the static mruList in ZipBundleFile. I think the mruList could become a final instance variable assigned from the constructor. This way BaseStorage could create a single MRUBundleFileList for all ZipBundleFile objects it creates. You will likely want to replace all direct accesses to the mruList with methods to do null checks when the old ZipBundleFile constructor is used or null is passed into the ZipBundleFile constructor. Notice that SignedBundleHook also creates ZipBundleFile objects. I think it is fine to us a null mruList here (basically disabled) because this code path should not keep the ZipBundleFile open for long periods of time. It reads the content and caches results and then closes the bundle file.
Created attachment 117184 [details] proposed patch
Created attachment 117234 [details] update patch Thanks Rob! That is what I was thinking. I have updated your patch with the following: - updated copyrights to include you - Changed ZipBundleEntry to use final fields and use a ZipBundleFile instead of plain BundleFile to avoid unnecessary casts. - moved shutdown of mruList to BaseStorage.frameworkStop(BundleContext) so the mruList can be a private field. I have also added a testcase to org.eclipse.osgi.tests.
I released the fix and testcase.
Comment on attachment 117184 [details] proposed patch Marking for the IP log. Thanks again Rob.
Thanks Tom - that's great