kafka-938; High CPU usage when more or less idle; patched by Sam Meder; 
reviewed by Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/6881bf08
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/6881bf08
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/6881bf08

Branch: refs/heads/trunk
Commit: 6881bf08f26ec64c056c6880922c4321679ba92d
Parents: ddb7947
Author: Sam Meder <sam.me...@gmail.com>
Authored: Tue Jun 11 22:43:41 2013 -0700
Committer: Jun Rao <jun...@gmail.com>
Committed: Tue Jun 11 22:43:41 2013 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/utils/DelayedItem.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6881bf08/core/src/main/scala/kafka/utils/DelayedItem.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/utils/DelayedItem.scala 
b/core/src/main/scala/kafka/utils/DelayedItem.scala
index 93c4482..d727649 100644
--- a/core/src/main/scala/kafka/utils/DelayedItem.scala
+++ b/core/src/main/scala/kafka/utils/DelayedItem.scala
@@ -37,7 +37,7 @@ class DelayedItem[T](val item: T, delay: Long, unit: 
TimeUnit) extends Delayed w
    */
   def getDelay(unit: TimeUnit): Long = {
     val elapsedMs = (SystemTime.milliseconds - createdMs)
-    unit.convert(max(delayMs - elapsedMs, 0), unit)
+    unit.convert(max(delayMs - elapsedMs, 0), TimeUnit.MILLISECONDS)
   }
     
   def compareTo(d: Delayed): Int = {

Reply via email to