kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-1673; potential java.lang.IllegalStateException in BufferPool.allocate(); patched by Jun Rao; reviewed by Jay Kreps
Date Mon, 06 Oct 2014 14:53:18 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.8.2 108f6d762 -> f43358197


kafka-1673; potential java.lang.IllegalStateException in BufferPool.allocate(); patched by
Jun Rao; reviewed by Jay Kreps


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

Branch: refs/heads/0.8.2
Commit: f43358197e2d2856543b3a345442fc1ddfa3240a
Parents: 108f6d7
Author: Jun Rao <junrao@gmail.com>
Authored: Mon Oct 6 07:53:00 2014 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Mon Oct 6 07:53:00 2014 -0700

----------------------------------------------------------------------
 .../kafka/clients/producer/internals/BufferPool.java   | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/f4335819/clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java
b/clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java
index 169a656..aa91e14 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java
@@ -125,14 +125,11 @@ public final class BufferPool {
                 // loop over and over until we have a buffer or have reserved
                 // enough memory to allocate one
                 while (accumulated < size) {
-                    try {
-                        long startWait = time.nanoseconds();
-                        moreMemory.await(300, TimeUnit.MILLISECONDS);
-                        long endWait = time.nanoseconds();
-                        this.waitTime.record(endWait - startWait, time.milliseconds());
-                     } catch (InterruptedException e) {
-                        // This should never happen. Just let it go.
-                    }
+                    long startWait = time.nanoseconds();
+                    moreMemory.await();
+                    long endWait = time.nanoseconds();
+                    this.waitTime.record(endWait - startWait, time.milliseconds());
+
                     // check if we can satisfy this request from the free list,
                     // otherwise allocate memory
                     if (accumulated == 0 && size == this.poolableSize &&
!this.free.isEmpty()) {


Mime
View raw message