Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21914

Set assert to check if exception is set in procedures

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: proc-v2
    • Labels:
      None

      Description

      Take CreateTableProcedure as an example, in executeFromState()

      case CREATE_TABLE_PRE_OPERATION:
        // Verify if we can create the table
        boolean exists = !prepareCreate(env);
        releaseSyncLatch();
        
        if (exists) {
          assert isFailed() : "the delete should have an exception here";
          return Flow.NO_MORE_STATE;
      }  
      

      The following assertion:

      assert isFailed() : "the delete should have an exception here";
      

      If I get the idea behind "the delete should have an exception here" correctly, it is to make sure that when setting the state to FAILED, the exception must be set. (or must call setFailure()). But the assertion only check isFailed() but no "!hasException()"

        Attachments

          Activity

            People

            • Assignee:
              xiangli Xiang Li
              Reporter:
              xiangli Xiang Li
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: