Possible race condition while loading plugins

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Possible race condition while loading plugins

Diego Basch
I'm seeing the following behavior, already reported in the past. The
scenario that causes
it is one where the nutch application is starting up and we have queries
coming in already.

in catalina.out:

050709 132712 11 query request from 211.30.2.xx
050709 132712 12 query request from 82.58.45.xx
050709 132712 11 Plugins: looking in: /var/local/nutch/build/plugins
050709 132714 13 query request from 193.77.93.xx

And in the error log an ExceptionInInitializerError, happening in the static
initializer for QueryFilters,
as described here:

http://www.mail-archive.com/nutch-developers@.../msg04422.html

It seems like there is a race condition: the plugins are not loaded (the
parsing plugin messages have
not appeared in the log yet), so the code below in QueryFilters.java does
not find any extension points
and throws the exception:

static {
try {
ExtensionPoint point = PluginRepository.getInstance()
.getExtensionPoint(QueryFilter.X_POINT_ID);
if (point == null)
throw new RuntimeException(QueryFilter.X_POINT_ID+" not found.");
...

When this happens, the system will not be able to process any queries since
NutchAnalysis.parse will fail
every time (QueryFilters is not a valid class). The application will need to
be restarted.

Diego