Details
Description
If someone uploads a corrupted files(i.e. 0-Byte or non readable pdf-content) the lucene index crashes. Even with a new full reindex the lucene indexer chrashes every time he touches the corrupted file.
I have analyzed the code. In the method doFullLuceneReindex() there is a Try- Catch block that catches the exception coming form the call getAttachmentContent(att.getName(), WikiProvider.LATEST_VERSION ).
But thus the indexer stops at this points and no other attachment will be added to the lucene index.
for( Iterator iterator = allAttachments.iterator(); iterator.hasNext(); )
{ Attachment att = (Attachment) iterator.next(); String text = getAttachmentContent( att.getName(), WikiProvider.LATEST_VERSION ); luceneIndexPage( att, text, writer ); }I would fixed it like this
for( Iterator iterator = allAttachments.iterator(); iterator.hasNext(); )
{
Attachment att = (Attachment) iterator.next();
try
catch (Throwable t)
{ //goto next Attachment iterator log.error("Error on indexing file " + att.getFileName(), t); }}