Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE on shutdown if solr disabled #354

Merged
merged 2 commits into from
Oct 7, 2015
Merged

Fix NPE on shutdown if solr disabled #354

merged 2 commits into from
Oct 7, 2015

Conversation

gallardo
Copy link
Contributor

@gallardo gallardo commented Oct 6, 2015

No description provided.

@gallardo
Copy link
Contributor Author

gallardo commented Oct 6, 2015

This doesn't look too harmful: a few indexes won't be shutdown, the m_indexes won't be cleared, the non-started SolrContainer won't be shutdown, but the NPE is a bit distracting.

tHerrmann added a commit that referenced this pull request Oct 7, 2015
Fix NPE on shutdown if solr disabled
@tHerrmann tHerrmann merged commit dad08f2 into alkacon:branch_9_5_x Oct 7, 2015
@gallardo gallardo deleted the patch-1 branch October 7, 2015 17:04
@gallardo
Copy link
Contributor Author

gallardo commented Oct 8, 2015

For the records (and for google): I have tested this today again, and I can confirm that this commit fixes an issue that arises during server shutdown: two threads stall, and the container must be manually killed. In the logs:

ERROR [  org.opencms.main.OpenCmsCore:1790] Error during search manager shutdown: null
java.lang.NullPointerException
    at org.opencms.search.solr.CmsSolrIndex.shutDown(CmsSolrIndex.java:504)
    at org.opencms.search.CmsSearchManager.shutDown(CmsSearchManager.java:2244)
    at org.opencms.main.OpenCmsCore.shutDown(OpenCmsCore.java:1787)
    at org.opencms.main.OpenCmsListener.contextDestroyed(OpenCmsListener.java:66)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
    at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
    at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[...] Shutting down [...]
[...] OpenCms stopped!     : Total uptime was [...]
WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [opencms] appears to have started a thread named [searcherExecutor-4-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:745)
WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [opencms] appears to have started a thread named [Thread-6] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.Object.wait(Object.java:502)
 org.apache.solr.core.CloserThread.run(CoreContainer.java:2075)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants