Opened 10 years ago

Closed 10 years ago

#1894 closed defect (fixed)

BASE is unloading JAR files too often

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.3.4
Component: core Version:
Keywords: Cc:

Description

When re-installing an extensions it seems like the JAR file is unloaded once for every plug-in definition it finds. This is not normally something that is noticed but in the end it means that we have some classes that are loaded by one class loader and some classes that are loaded by a different class loader from the same extension.

This issue popped up in a use case where some configuration settings are stored in a static reference (XmlConfig: http://baseplugins.thep.lu.se/browser/extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java?rev=2894#L217)

Re-loading the configuration only changes the configuration for one of the classloaders and not the other meaning that some parts now have stale configuration information.

Basically, the problematic part is this call to JarClassLoader.unload() http://base.thep.lu.se/browser/tags/3.3.3/src/core/net/sf/basedb/core/PluginDefinition.java#L1267

It should be removed and merged into the second parameter of the next line instead.

The only known workaround is to restart the server.

Change History (1)

comment:1 by Nicklas Nordborg, 10 years ago

Resolution: fixed
Status: newclosed

(In [6636]) Fixes #1894: BASE is unloading JAR files too often

Deprecating JarClassLoader.unload since forcing an unload will trigger the problem if not all references are updated at the same time. This can only be ensured by the extensions installation wizard so it should all be handled from there via the autoUnload parameter.

As a consequence, the possibility to manually unload plug-ins from the web gui has been removed.

Note: See TracTickets for help on using tickets.