infdahai commented on code in PR #1464:
URL: 
https://github.com/apache/incubator-kvrocks/pull/1464#discussion_r1202524743


##########
tests/gocase/integration/slotmigrate/slotmigrate_test.go:
##########
@@ -418,12 +418,19 @@ func TestSlotMigrateSync(t *testing.T) {
                require.NoError(t, result.Err())
                require.Equal(t, "OK", result.Val())
 
-               timeouts := []interface{}{-1, 0, 20, 10.5, -3.14}
-               for _, timeout := range timeouts {
+               invalidTimeouts := []interface{}{-2, -1, "abc"}

Review Comment:
   Does it need to add a float argument to show the above dicussion?



##########
src/commands/cmd_cluster.cc:
##########
@@ -146,7 +146,14 @@ class CommandClusterX : public Commander {
           sync_migrate_ = true;
 
           if (args.size() == 6) {
-            sync_migrate_timeout_ = GET_OR_RET(ParseFloat<float>(args[5]));
+            auto parse_result = ParseInt<int>(args[5], 10);
+            if (!parse_result) {
+              return {Status::RedisParseErr, "timeout is not an integer or out 
of range"};
+            }
+            if (*parse_result < 0) {
+              return {Status::RedisParseErr, "timeout should not be negative"};

Review Comment:
   ```suggestion
   return {Status::RedisParseErr, errTimeoutIsNegative};
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to