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

Xiang Li commented on HBASE-21914:
----------------------------------

Hi [~xucang], I got your idea. 
Do you mind check the latest master branch
{code:title=Procedure.java|borderStyle=solid}
public synchronized boolean isFailed() {
    return state == ProcedureState.FAILED || state == ProcedureState.ROLLEDBACK;
  }
{code}
Checking in git log, that was changed from the version in comment to the one 
above by HBASE-17863

> Set assert to check if exception is set in procedures
> -----------------------------------------------------
>
>                 Key: HBASE-21914
>                 URL: https://issues.apache.org/jira/browse/HBASE-21914
>             Project: HBase
>          Issue Type: Bug
>          Components: proc-v2
>            Reporter: Xiang Li
>            Assignee: Xiang Li
>            Priority: Critical
>
> Take CreateTableProcedure as an example, in executeFromState()
> {code:java}
> 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;
> }  
> {code}
> The following assertion:
> {code}
> assert isFailed() : "the delete should have an exception here";
> {code}
> 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()"



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to