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

Set assert to check if exception is set in procedures

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • proc-v2
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            xiangli Xiang Li
            xiangli Xiang Li

            Dates

              Created:
              Updated:

              Slack

                Issue deployment