Skip to content

Commit

Permalink
Print transient failure on tx leader retry for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Oct 13, 2016
1 parent 00f0f0b commit 12efc19
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,18 @@ private CoreClusterMember leaderTx( BiConsumer<CoreGraphDatabase, Transaction> o
throw new DatabaseShutdownException();
}

try
try ( Transaction tx = db.beginTx() )
{
Transaction tx = db.beginTx();
op.accept( db, tx );
tx.close();
return member;
}
catch ( Throwable e )
{
if ( isTransientFailure( e ) )
{
// this is not the best, but it helps in debugging
System.err.println( "Transient failure in leader transaction, trying again." );
e.printStackTrace();
// sleep and retry
Thread.sleep( DEFAULT_BACKOFF_MS );
}
Expand Down

0 comments on commit 12efc19

Please sign in to comment.