java - Lucene LockObtainFailedException -
i trying write lucene , following error. showing full trace. thoughts on how might fix this?
org.apache.lucene.store.lockobtainfailedexception: lock obtain timed out: com.googlecode.luceneappengine.gaelockfactory$1@153c8fb @ org.apache.lucene.store.lock.obtain(lock.java:89) @ org.apache.lucene.index.indexwriter.<init>(indexwriter.java:755) @ com.company.dogcloud.taskqueue.lucene.luceneworker.updatedogdocument(luceneworker.java:61) @ com.company.dogcloud.taskqueue.lucene.luceneworker.dopost(luceneworker.java:147) @ javax.servlet.http.httpservlet.service(httpservlet.java:637) @ javax.servlet.http.httpservlet.service(httpservlet.java:717) @ org.mortbay.jetty.servlet.servletholder.handle(servletholder.java:511) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1166) @ com.googlecode.objectify.cache.asynccachefilter.dofilter(asynccachefilter.java:58) @ com.googlecode.objectify.objectifyfilter.dofilter(objectifyfilter.java:48) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.apphosting.utils.servlet.parseblobuploadfilter.dofilter(parseblobuploadfilter.java:125) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.apphosting.runtime.jetty.savesessionfilter.dofilter(savesessionfilter.java:35) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.apphosting.utils.servlet.jdbcmysqlconnectioncleanupfilter.dofilter(jdbcmysqlconnectioncleanupfilter.java:60) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ com.google.apphosting.utils.servlet.transactioncleanupfilter.dofilter(transactioncleanupfilter.java:43) @ org.mortbay.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1157) @ org.mortbay.jetty.servlet.servlethandler.handle(servlethandler.java:388) @ org.mortbay.jetty.security.securityhandler.handle(securityhandler.java:216) @ org.mortbay.jetty.servlet.sessionhandler.handle(sessionhandler.java:182) @ org.mortbay.jetty.handler.contexthandler.handle(contexthandler.java:765) @ org.mortbay.jetty.webapp.webappcontext.handle(webappcontext.java:418) @ com.google.apphosting.runtime.jetty.appversionhandlermap.handle(appversionhandlermap.java:254) @ org.mortbay.jetty.handler.handlerwrapper.handle(handlerwrapper.java:152) @ org.mortbay.jetty.server.handle(server.java:326) @ org.mortbay.jetty.httpconnection.handlerequest(httpconnection.java:542) @ org.mortbay.jetty.httpconnection$requesthandler.headercomplete(httpconnection.java:923) @ com.google.apphosting.runtime.jetty.rpcrequestparser.parseavailable(rpcrequestparser.java:76) @ org.mortbay.jetty.httpconnection.handle(httpconnection.java:404) @ com.google.apphosting.runtime.jetty.jettyservletengineadapter.servicerequest(jettyservletengineadapter.java:146) @ com.google.apphosting.runtime.javaruntime$requestrunnable.run(javaruntime.java:527) @ com.google.tracing.tracecontext$tracecontextrunnable.runincontext(tracecontext.java:437) @ com.google.tracing.tracecontext$tracecontextrunnable$1.run(tracecontext.java:444) @ com.google.tracing.currentcontext.runincontext(currentcontext.java:230) @ com.google.tracing.tracecontext$abstracttracecontextcallback.runininheritedcontextnounref(tracecontext.java:308) @ com.google.tracing.tracecontext$abstracttracecontextcallback.runininheritedcontext(tracecontext.java:300) @ com.google.tracing.tracecontext$tracecontextrunnable.run(tracecontext.java:441) @ com.google.apphosting.runtime.threadgrouppool$poolentry.run(threadgrouppool.java:251) @ java.lang.thread.run(thread.java:745)
for each lucene directory, can opened 1 indexwriter @ time. locking exception means either:
- you opening indexwriter in parallel other requests, causing contention.
- you have lock still present on filesystem previous run of application wasn't closed correctly (crashed?)
- the same index being written different application
if in first case, should make sure share indexwriter instance across different threads , manage lifecycle accordingly. or use library helps dealing lucene efficiently, hibernate search or infinispan index , query things on lucene when using (respectively) hibernate or simpler hashmap-like structure.
Comments
Post a Comment