Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-13037

Under some circumstances, transaction failures can make a program unable to start further transactions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.2
    • Fix Version/s: 4.3.3
    • Component/s: App Fabric, Datasets
    • Labels:
    • Release Notes:
      Make TransactionContext resilient against getTransactionAwareName() failures
    • Rank:
      1|i00af3:

      Description

      Here is where it can go wrong:

        private void persist() throws TransactionFailureException {
          for (TransactionAware txAware : getTransactionAwares()) {
            boolean success = false;
            Throwable cause = null;
            try {
              success = txAware.commitTx();
            } catch (Throwable e) {
              cause = e;
            }
            if (!success) {
              // HERE is the problem:
              // if getTransactionAwareName() throws, abort() is not called
      
              abort(new TransactionFailureException(
                String.format("Unable to persist changes of transaction-aware '%s' for transaction %d. ",
                              txAware.getTransactionAwareName(), currentTx.getTransactionId()), cause));
            }
          }
        }
      

      and a handful other places in (Abstract)TransactionContext.

      Because getTransactionAwareName() is user-defined, we must protect against exceptions thrown from there and make sure transactions abort properly.

        Attachments

          Activity

            People

            • Assignee:
              andreas Andreas Neumann
              Reporter:
              andreas Andreas Neumann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: