import java.util.LinkedHashSet;
import java.util.Set;
import java.util.SplittableRandom;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
@Override
public void onTransactionChainFailed(final TransactionChain<?, ?> chain,
final AsyncTransaction<?, ?> transaction, final Throwable cause) {
- LOG.warn("Transaction chain failed.", cause);
- completionFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", cause).build());
+ // This is expected to happen frequently in isolation testing.
+ LOG.debug("Transaction chain failed.", cause);
+ // Do not return RPC here, rely on transaction failure to call runFailed.
}
@Override
tx.merge(LogicalDatastoreType.CONFIGURATION, idListItem, entry);
try {
- tx.submit().checkedGet(INIT_TX_TIMEOUT_SECONDS, TimeUnit.SECONDS);
- } catch (final Exception e) {
+ tx.submit().get(INIT_TX_TIMEOUT_SECONDS, TimeUnit.SECONDS);
+ } catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.warn("Unable to ensure IdInts list for id: {} exists.", id, e);
return Futures.immediateFuture(RpcResultBuilder.<WriteTransactionsOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
tx.put(LogicalDatastoreType.CONFIGURATION, itemListId, mapBuilder.build());
try {
- tx.submit().checkedGet(INIT_TX_TIMEOUT_SECONDS, TimeUnit.SECONDS);
- } catch (final Exception e) {
+ tx.submit().get(INIT_TX_TIMEOUT_SECONDS, TimeUnit.SECONDS);
+ } catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.warn("Unable to fill the initial item list.", e);
return Futures.immediateFuture(RpcResultBuilder.<WriteTransactionsOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());