[ 
https://issues.apache.org/jira/browse/SENTRY-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16121748#comment-16121748
 ] 

Na Li commented on SENTRY-1878:
-------------------------------

Vamsee hard-coded the exception in SentryStore.execute(). We can make it 
configurable. Also the execution can be [normal transaction, EXCEPTION BLOCK, 
delta transaction] OR  [normal transaction, delta transaction, EXCEPTION BLOCK] 

private void execute(DeltaTransactionBlock deltaTransactionBlock,
  TransactionBlock<Object> transactionBlock) throws Exception {
    List<TransactionBlock<Object>> tbs = Lists.newArrayList();
    tbs.add(transactionBlock);
    if (deltaTransactionBlock != null) {
      tbs.add(deltaTransactionBlock);
      // FOr every 50 transactions insert a failure
      final int value = transactionCount.incrementAndGet();
      if (value % 50 == 0) {
        tbs.add(new TransactionBlock<Object>() {
          public Object execute(PersistenceManager pm) throws Exception {
            throw new Exception("VAMSEE INTRODUCING EXCEPTION for transID: " + 
value);
          }
        });
      }
    }
    tm.executeTransactionBlocksWithRetry(tbs);
  }

> Provide support for programmatic fault injections for transactions
> ------------------------------------------------------------------
>
>                 Key: SENTRY-1878
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1878
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 2.0.0
>            Reporter: Alexander Kolbasov
>            Assignee: Alexander Kolbasov
>
> For testing purposes it would be very useful to be able to insert faults 
> while running transactions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to