- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.4k
HBASE-27799: RpcThrottlingException wait interval message is misleading between 0-1s #5192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and easy. Can you actually just add a quick test?
6004e21    to
    fec0eda      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks! Looks good. Will merge once I have time after pre commit comes back green.
| 💔 -1 overall 
 
 This message was automatically generated. | 
| 💔 -1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| Thank you! I think those first failures are because I force pushed a change | 
|  | ||
| private static String stringFromMillis(long millis) { | ||
| if (millis >= 1000) { | ||
| return StringUtils.formatTime(millis); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I realize this will continue to be misleading for values greater than 1s. For example 1.9s is almost double what would be shown by formatTime. It matters less for values in the 10s of seconds or higher, but I think it will be very common to have values mostly in the single digit seconds.
We could copy the impl of formatTime here and add ms, or use the existing formatTime and append a ms part, or look for a different "humanize" method/library (as long as it's already a dep)
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| @rmdmattingly can you fix the javac warnings? | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| i dont have time to handle merging right now, but will try to do it in the next couple days. thanks! | 
| @bbeaudreault while working on https://issues.apache.org/jira/browse/HBASE-27798 I realized that there's an extra change that I want to make here. These changes would break hbase/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java Lines 162 to 183 in e87b3ed 
 Though notably,  | 
| if (i == 1) { | ||
| time += Math.round(Float.parseFloat(m.group(1)) * 1000); // sec | ||
| time += Math.round(Float.parseFloat(m.group(2))); // ms | ||
| } | ||
| if (i == 2) { | ||
| time += Math.round(Float.parseFloat(m.group(1)) * 60 * 1000); // mins | ||
| time += Math.round(Float.parseFloat(m.group(2)) * 1000); // sec | ||
| time += Math.round(Float.parseFloat(m.group(3))); // ms | ||
| } | ||
| if (i == 3) { | ||
| time += Math.round(Float.parseFloat(m.group(1)) * 60 * 60 * 1000); // hrs | ||
| time += Math.round(Float.parseFloat(m.group(2)) * 60 * 1000); // mins | ||
| time += Math.round(Float.parseFloat(m.group(3)) * 1000); // sec | ||
| time += Math.round(Float.parseFloat(m.group(4))); // ms | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admittedly we could clean this up a bit via some sort of loop, but I think the initial implementation suffered from trying to be a little too clever and this both works and is straightforward imo
| HBaseClassTestRule.forClass(TestRpcThrottlingException.class); | ||
|  | ||
| @Test | ||
| public void itHandlesSecWaitIntervalMessage() { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also test that it still works for the old format. We need to make sure it doesn't break if someone deploys the updated client side with old servers or vice versa.
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
        
          
                hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
        
          
                hbase-client/src/test/java/org/apache/hadoop/hbase/quotas/TestRpcThrottlingException.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
        
          
                hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottlingException.java
          
            Show resolved
            Hide resolved
        
      | 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
| 🎊 +1 overall 
 
 This message was automatically generated. | 
…ng between 0-1s (#5192) Signed-off-by: Bryan Beaudreault <[email protected]>
…ng between 0-1s (#5192) Signed-off-by: Bryan Beaudreault <[email protected]>
…ng between 0-1s (#5192) Signed-off-by: Bryan Beaudreault <[email protected]>
…ng between 0-1s (apache#5192) Signed-off-by: Bryan Beaudreault <[email protected]>
…ng between 0-1s (apache#5192) (#52) Signed-off-by: Bryan Beaudreault <[email protected]>
…ng between 0-1s (apache#5192) Signed-off-by: Bryan Beaudreault <[email protected]> (cherry picked from commit 05de158) Change-Id: Ic2755a64fa017d56a77e42355266af5b615d0f40
StringUtils#formatTimewill round down millis which can produce misleading error messages on RpcThrottlingExceptions with wait intervals between 0 and 1 second. This PR simply adds support expressing sub-second wait intervals@bbeaudreault