Buggy code:
public class TransactionalSpoutCoordinator implements IRichSpout { public static final Logger LOG = Logger . getLogger ( TransactionalSpoutCoordinator . class ) ; public static final BigInteger INIT_TXID = new BigInteger ( "1" ) ; public static final String TRANSACTION_BATCH_STREAM_ID = ( TransactionalSpoutCoordinator . class . getName ( ) ) + "//batch" ; public static final String TRANSACTION_COMMIT_STREAM_ID = ( TransactionalSpoutCoordinator . class . getName ( ) ) + "//commit" ; private static final String CURRENT_TX = "currtx" ; private static final String META_DIR = "meta" ; private ITransactionalSpout _spout ; private Coordinator _coordinator ; private TransactionalState _state ; private RotatingTransactionalState _coordinatorState ; Map < BigInteger , TransactionalSpoutCoordinator . TransactionStatus > _activeTx = new HashMap < BigInteger , TransactionalSpoutCoordinator . TransactionStatus > ( ) ; private SpoutOutputCollector _collector ; BigInteger _currTransaction ; int _maxTransactionActive ; TransactionalSpoutCoordinator . StateInitializer _initializer ; public TransactionalSpoutCoordinator ( ITransactionalSpout spout ) { } public ITransactionalSpout getSpout ( ) { } @ Override public void open ( Map conf , TopologyContext context , SpoutOutputCollector collector ) { } @ Override public void close ( ) { } @ Override public void nextTuple ( ) { } @ Override public void ack ( Object msgId ) { } @ Override public void fail ( Object msgId ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } private void sync ( ) { TransactionalSpoutCoordinator . TransactionStatus maybeCommit = _activeTx . get ( _currTransaction ) ; if ( ( maybeCommit != null ) && ( ( maybeCommit . status ) == ( TransactionalSpoutCoordinator . AttemptStatus . PROCESSED ) ) ) { maybeCommit . status = TransactionalSpoutCoordinator . AttemptStatus . COMMITTING ; _collector . emit ( TransactionalSpoutCoordinator . TRANSACTION_COMMIT_STREAM_ID , new backtype . storm . tuple . Values ( maybeCommit . attempt ) , maybeCommit . attempt ) ; } try { if ( ( _activeTx . size ( ) ) < ( _maxTransactionActive ) ) { BigInteger curr = _currTransaction ; for ( int i = 0 ; i < ( _maxTransactionActive ) ; i ++ ) { if ( ! ( _activeTx . containsKey ( curr ) ) ) { TransactionAttempt attempt = new TransactionAttempt ( curr , Utils . randomLong ( ) ) ; Object state = _coordinatorState . getState ( curr , _initializer ) ; _activeTx . put ( curr , new TransactionalSpoutCoordinator . TransactionStatus ( attempt ) ) ; _collector . emit ( TransactionalSpoutCoordinator . TRANSACTION_BATCH_STREAM_ID , new backtype . storm . tuple . Values ( attempt , state , _currTransaction ) , attempt ) ; } curr = nextTransactionId ( curr ) ; } } <START_BUG> } catch ( FailedTransactionException e ) { <END_BUG> TransactionalSpoutCoordinator . LOG . warn ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>metadata<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>transaction" , e ) ; } } @ Override public Map < String , Object > getComponentConfiguration ( ) { } private static enum AttemptStatus { PROCESSING , PROCESSED , COMMITTING ; } private static class TransactionStatus { TransactionAttempt attempt ; TransactionalSpoutCoordinator . AttemptStatus status ; public TransactionStatus ( TransactionAttempt attempt ) { } @ Override public String toString ( ) { } } private static final BigInteger ONE = new BigInteger ( "1" ) ; private BigInteger nextTransactionId ( BigInteger id ) { } private BigInteger getStoredCurrTransaction ( TransactionalState state ) { } private class StateInitializer implements RotatingTransactionalState . StateInitializer { @ Override public Object init ( BigInteger txid , Object lastState ) { } } }

Fix:
} catch ( FailedBatchException e ) {