ijuma commented on a change in pull request #9347: URL: https://github.com/apache/kafka/pull/9347#discussion_r499079604
########## File path: clients/src/main/java/org/apache/kafka/common/utils/Utils.java ########## @@ -331,6 +331,11 @@ public static ByteBuffer wrapNullable(byte[] array) { */ public static void sleep(long ms) { try { + if (ms <= 0) { + // No need to sleep + log.debug("Skipping sleep as asked to sleep for {} msec", ms); Review comment: Overflow is not uncommon when using things like Long.MaxValue, so assuming negative is not a bug seems dangerous. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org