Skip to content
Browse files

markIndexerDead should handle IOEx

By logging, and not disturbing caller with it, as caller
called us already coz it had one.
  • Loading branch information...
1 parent c1aadf3 commit 9e2dcf5ba007f2ac84d51c70d96c3af8e68d706b @cstamas cstamas committed Nov 14, 2012
View
14 ...s/nexus-timeline-plugin/src/main/java/org/sonatype/timeline/internal/DefaultTimeline.java
@@ -309,7 +309,9 @@ public Void doIt()
}
catch ( final IOException ee )
{
- getLogger().warn( "Unable to operate against Timeline indexer after repair!", e );
+ // it is only the Work declaring IOEx, it will be not thrown
+ // in markIndexerDead method!
+ getLogger().warn( "Unable to cleanly disable Timeline indexer.", e );
}
}
finally
@@ -340,14 +342,20 @@ public Void doIt()
private volatile boolean indexerIsDead = false;
protected void markIndexerDead( final Exception e )
- throws IOException
{
if ( !indexerIsDead )
{
getLogger().warn( "Timeline index got corrupted and is disabled. Repair will be tried on next boot.", e );
// we need to stop it and signal to not try any other thread
indexerIsDead = true;
- indexer.stop();
+ try
+ {
+ indexer.stop();
+ }
+ catch ( IOException ex )
+ {
+ getLogger().warn( "Timeline index can't be stopped cleanly after it's corruption.", ex );
+ }
}
}
}

0 comments on commit 9e2dcf5

Please sign in to comment.
Something went wrong with that request. Please try again.