kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject kafka git commit: KAFKA-4725; Stop leaking messages in produce request body when requests are delayed
Date Tue, 07 Feb 2017 23:12:51 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 6cef4f5e4 -> 7f6bf5d44

KAFKA-4725; Stop leaking messages in produce request body when requests are delayed

This change is in response to [KAFKA-4725](https://issues.apache.org/jira/browse/KAFKA-4725).

When a produce request is received, if the user/client is exceeding their produce quota, the
response will be delayed until the quota is refilled appropriately.

Unfortunately, the request body is still referenced in the callback which in turn leaks the
messages contained within the request.

This change allows the `KafkaApis` method to take ownership of the request body from the `RequestChannel.Request`

I am not sure whether this breaks other invariants which are assumed within other parts of

Author: Tim Carey-Smith <tim@spork.in>

Reviewers: Ismael Juma <ismael@juma.me.uk>, Jun Rao <junrao@gmail.com>

Closes #2496 from halorgium/fix-throttled-response-leak

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

Branch: refs/heads/trunk
Commit: 7f6bf5d44796ac14665d5ba8c2243f5d7f5d30bd
Parents: 6cef4f5
Author: Tim Carey-Smith <tim@spork.in>
Authored: Tue Feb 7 15:12:47 2017 -0800
Committer: Jun Rao <junrao@gmail.com>
Committed: Tue Feb 7 15:12:47 2017 -0800

 .../main/java/org/apache/kafka/common/requests/ProduceRequest.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java b/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java
index e4a2aae..bd3ae8f 100644
--- a/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java
+++ b/clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java
@@ -160,6 +160,7 @@ public class ProduceRequest extends AbstractRequest {
     public void clearPartitionRecords() {
+        struct.clear();

View raw message