You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "imbajin (via GitHub)" <gi...@apache.org> on 2023/03/07 11:47:29 UTC

[GitHub] [incubator-hugegraph] imbajin commented on a diff in pull request #2130: feat: support task auto manage by server role state machine

imbajin commented on code in PR #2130:
URL: https://github.com/apache/incubator-hugegraph/pull/2130#discussion_r1127713314


##########
hugegraph-test/src/main/java/org/apache/hugegraph/core/RoleElectionStateMachineTest.java:
##########
@@ -234,7 +240,7 @@ public boolean updateIfNodePresent(RoleTypeData stateData) {
                     if (Objects.equals(value.node(), copy.node()) &&

Review Comment:
   if the value could be `null` here?



##########
hugegraph-core/src/main/java/org/apache/hugegraph/masterelection/StandardRoleElectionStateMachine.java:
##########
@@ -49,7 +53,11 @@ public void apply(StateMachineCallback stateMachineCallback) {
         while (!this.shutdown) {
             E.checkArgumentNotNull(this.state, "State don't be null");
             try {
+                RoleState pre = this.state;
                 this.state = state.transform(context);

Review Comment:
   Note: `state.transform` is not an atomic operation



-- 
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: dev-unsubscribe@hugegraph.apache.org

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