Copilot commented on code in PR #2324:
URL: 
https://github.com/apache/incubator-pegasus/pull/2324#discussion_r2560753674


##########
go-client/admin/client.go:
##########
@@ -151,7 +173,7 @@ func (c *rpcBasedClient) waitTableReady(tableName string, 
partitionCount int32,
        }
 
        if maxWaitSeconds <= 0 {
-               return fmt.Errorf("After %d seconds, table '%s' is still not 
ready", maxWaitSeconds, tableName)
+               return fmt.Errorf("after %d seconds, table '%s' is still not 
ready", maxWaitSeconds, tableName)

Review Comment:
   The error message uses the decremented `maxWaitSeconds` value (which will be 
0 or negative), not the original timeout value. This will result in messages 
like "after 0 seconds, table 'X' is still not ready" instead of showing the 
actual wait time. Consider storing the original value before the loop:
   ```go
   originalWaitSeconds := maxWaitSeconds
   for ; maxWaitSeconds > 0; maxWaitSeconds-- {
       // ...
   }
   if maxWaitSeconds <= 0 {
       return fmt.Errorf("after %d seconds, table '%s' is still not ready", 
originalWaitSeconds, tableName)
   }
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to