[Dspace-devel] Lock Obtain Timed Out

0 views
Skip to first unread message

Richard Jones

unread,
Aug 18, 2015, 3:38:29 PM8/18/15
to dspace-devel, DSpac...@lists.sourceforge.net
Hi,

Anyone seen this error before, or know what do do about it? Even
restarting tomcat doesn't seem to have made it go away.

It occurs when I opened an Item Template for editing, added a
pre-defined metadata field, hit "Add", but did not hit "Update" before I
moved away from the page. Now I get this error every time I try an
access the Item Template in any of the collections in my system.

Cheers,

Richard
-------
Richard Jones
Systems Developer A crash reduces
Edinburgh University Library your expensive computer
Theses Alive! project to a simple stone

e: r.d....@ed.ac.uk
t: 0131 651 1612

Theses Alive! homepage: http://www.thesesalive.ac.uk/
Edinburgh Research Archive: http://www.era.lib.ed.ac.uk/

-----Original Message-----
From: era....@ed.ac.uk [mailto:era....@ed.ac.uk]
Sent: 25 August 2004 10:16
To: era....@ed.ac.uk
Subject: ERA: Internal Server Error

Date: 8/25/04 10:39 AM
Session ID: AD884BB6C7DADE6C2ABCDF6E7DD93AFB

-- URL Was:
http://www.era-test.lib.ed.ac.uk/dspace/dspace-admin/edit-communities
-- Method: POST
-- Parameters were:
-- copyright_text: ""
-- license: ""
-- provenance_description: ""
-- action: "9"
-- create: "false"
-- short_description: ""
-- collection_id: "140"
-- side_bar_text: ""
-- introductory_text: "null"
-- submit_create_template: "Create..."
-- community_id: "33"
-- name: "Earth Sciences (Theses and Dissertations)"


Exception:
java.io.IOException: Lock obtain timed out
at org.apache.lucene.store.Lock.obtain(Lock.java:97)
at
org.apache.lucene.index.IndexReader.delete(IndexReader.java:371)
at
org.apache.lucene.index.IndexReader.delete(IndexReader.java:404)
at
org.dspace.search.DSIndexer.unIndexContent(DSIndexer.java:129)
at
org.dspace.search.DSIndexer.unIndexContent(DSIndexer.java:116)
at
org.dspace.search.DSIndexer.reIndexContent(DSIndexer.java:147)
at org.dspace.content.Collection.update(Collection.java:820)
at
org.dspace.app.webui.servlet.admin.EditCommunitiesServlet.processConfirm
EditCollection(EditCommunitiesServlet.java:588)
at
org.dspace.app.webui.servlet.admin.EditCommunitiesServlet.doDSPost(EditC
ommunitiesServlet.java:244)
at
org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.
java:153)
at
org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:110
)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
at
org.dspace.app.webui.filter.AdminOnlyFilter.doFilter(AdminOnlyFilter.jav
a:110)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
7)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequest
Handler.java:217)
at
org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.jav
a:194)
at java.lang.Thread.run(Thread.java:536)




Richard Jones

unread,
Aug 18, 2015, 3:38:32 PM8/18/15
to Jim Downing, dspace-tech, dspace-devel
Hi Jim,

Cheers for this - deleting the lock file gets rid of the problem once,
but it respawns another straight after and then you get the error again
;(

I've checked out a copy of the DSpace CVS finally so I'll have a look at
it and see if I can find out what's wrong.

So far what I can say for sure is that neither Add nor Update on the
Item Template page actually get anything into the database. Is anyone
having that problem (ignoring the lucene lock file)?

Cheers,

Richard
-------
Richard Jones
Systems Developer A crash reduces
Edinburgh University Library your expensive computer
Theses Alive! project to a simple stone

e: r.d....@ed.ac.uk
t: 0131 651 1612

Theses Alive! homepage: http://www.thesesalive.ac.uk/
Edinburgh Research Archive: http://www.era.lib.ed.ac.uk/

> -----Original Message-----
> From: dspace-t...@lists.sourceforge.net
> [mailto:dspace-t...@lists.sourceforge.net] On Behalf Of
> Jim Downing
> Sent: 25 August 2004 10:50
> To: dspace-tech
> Subject: [Dspace-tech] Re: [Dspace-devel] Lock Obtain Timed Out
>
>
> On Wed, 2004-08-25 at 10:22, Richard Jones wrote:
> > Hi,
> >
> > Anyone seen this error before, or know what do do about it? Even
> > restarting tomcat doesn't seem to have made it go away.
> >
> > It occurs when I opened an Item Template for editing, added a
> > pre-defined metadata field, hit "Add", but did not hit
> "Update" before
> > I moved away from the page. Now I get this error every
> time I try an
> > access the Item Template in any of the collections in my system.
>
> Hi Richard,
>
> Further to the advice to delete the lucene locks from /tmp
> and $TOMCAT_HOME/temp
> (http://sourceforge.net/mailarchive/message.php?msg_id=9116623
), I've just checked a couple of improvements to the indexing code that
*should* prevent this one resurfacing.

N.B. There is another problem occuring here that caused the lucene
connections not to be released. If you could isolate the underlying bug
that would be great.

cheers,
jim



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save
50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
DSpace-tech mailing list
DSpac...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


Richard Jones

unread,
Aug 18, 2015, 3:38:33 PM8/18/15
to Jim Downing, dspace-tech, dspace-devel
Hi Jim,

I can't get the error to replicate in the CVS version of the code, so it
seems as though your changes may have fixed the problem. I did notice
that where it says:

public static void unIndexContent(Context c, String myhandle)
throws SQLException, IOException
{
String index_directory =
ConfigurationManager.getProperty("search.dir");
IndexReader ir = IndexReader.open(index_directory);

if( myhandle != null )
{
// we have a handle (our unique ID, so remove)
Term t = new Term("handle", myhandle);
try {
ir.delete(t);
}
finally {
ir.close();
}
}
else
{
log.warn("unindex of content with null handle attempted");
// FIXME: no handle, fail quietly - should log failure
//System.out.println("Error in unIndexContent: Object had no
handle!");
}
}

There is no ir.close() method called if the item has no handle (like an
item template). Could this cause a problem?

The lock file that is sticking on my system is created when you hit
"Add" on the item template page, and the above method is called during
that procedure which is why I wonder about the ir.close() method. There
are also a number of other indexing methods that get called
subsequently. Does anyone know exactly when the lock file gets created?

I won't check in a change unless I know that it's needed.

Jim Downing

unread,
Aug 18, 2015, 3:38:34 PM8/18/15
to Richard Jones, dspace-devel
Hi Richard,

woops! Right you are, thanks for spotting that. Correction checked in.

jim
Reply all
Reply to author
Forward
0 new messages