You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/28 05:02:13 UTC

[GitHub] [shardingsphere] csonezp edited a comment on issue #15051: Add unit test for InstanceContext

csonezp edited a comment on issue #15051:
URL: https://github.com/apache/shardingsphere/issues/15051#issuecomment-1023888707


   @menghaoranss 
   
   Hi,i have some doubts after reading the code.
   
   InstanceContext#switchInstanceState:
   
   ```    
   private void switchInstanceState(final Collection<String> status) {
           state.switchState(StateType.CIRCUIT_BREAK, null != status && status.contains(StateType.CIRCUIT_BREAK.name()));
       }
   ```
   
   The effect of these codes is to put CIRCUIT_BREAK into StateContext#currentState when the `status` is contain CIRCUIT_BREAK, or run currentState.pop() when `status` not contain CIRCUIT_BREAK.
   
   Does InstanceContext only pay attention to the state of CIRCUIT_BREAK ?  
   
   When will method switchInstanceState be called ?
   
   Thanks !
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org