diff --git a/contrib/dataimporthandler/CHANGES.txt b/contrib/dataimporthandler/CHANGES.txt index 82b294d4f64..709dba9392b 100644 --- a/contrib/dataimporthandler/CHANGES.txt +++ b/contrib/dataimporthandler/CHANGES.txt @@ -57,6 +57,8 @@ Bug Fixes * SOLR-1762: DateFormatTransformer does not work correctly with non-default locale dates (tommy chheng via noble) +* SOLR-1757: DIH multithreading sometimes throws NPE (noble) + Other Changes ---------------------- diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java index 543b93620bb..42423a21e78 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java @@ -345,11 +345,11 @@ public class DocBuilder { private DocWrapper docWrapper; private volatile boolean entityInitialized ; String currentProcess; - ThreadLocal currentEntityProcWrapper = new ThreadLocal(); + final ThreadLocal currentEntityProcWrapper = new ThreadLocal(); private ContextImpl context; - EntityRunner parent; - AtomicBoolean entityEnded = new AtomicBoolean(false); + final EntityRunner parent; + final AtomicBoolean entityEnded = new AtomicBoolean(false); private Exception exception; public EntityRunner(DataConfig.Entity entity, EntityRunner parent) { diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java index 6398cf6e870..cb38e480bf0 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java @@ -126,8 +126,6 @@ public class JdbcDataSource extends return factory = new Callable() { public Connection call() throws Exception { - // Resolve variables again because the variables may have changed - resolveVariables(context, initProps); LOG.info("Creating a connection for entity " + context.getEntityAttribute(DataImporter.NAME) + " with URL: " + url); diff --git a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedEntityProcessorWrapper.java b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedEntityProcessorWrapper.java index 8cb857e1543..692be738163 100644 --- a/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedEntityProcessorWrapper.java +++ b/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/ThreadedEntityProcessorWrapper.java @@ -36,10 +36,10 @@ import java.util.Collections; public class ThreadedEntityProcessorWrapper extends EntityProcessorWrapper { private static final Logger LOG = LoggerFactory.getLogger(ThreadedEntityProcessorWrapper.class); - DocBuilder.EntityRunner entityRunner; + final DocBuilder.EntityRunner entityRunner; /**For each child entity there is one EntityRunner */ - Map children; + final Map children; public ThreadedEntityProcessorWrapper(EntityProcessor delegate, DocBuilder docBuilder, DocBuilder.EntityRunner entityRunner,