kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsiva...@apache.org
Subject [kafka] branch 2.2 updated: KAFKA-7288 - Make sure no bytes buffered when relying on idle timeout in channel close test (#6390)
Date Thu, 07 Mar 2019 18:30:21 GMT
This is an automated email from the ASF dual-hosted git repository.

rsivaram pushed a commit to branch 2.2
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.2 by this push:
     new 64eb5c1  KAFKA-7288 - Make sure no bytes buffered when relying on idle timeout in
channel close test (#6390)
64eb5c1 is described below

commit 64eb5c15dacf8084537b80c484329eb2ef72aa00
Author: Rajini Sivaram <rajinisivaram@googlemail.com>
AuthorDate: Thu Mar 7 18:09:50 2019 +0000

    KAFKA-7288 - Make sure no bytes buffered when relying on idle timeout in channel close
test (#6390)
    
    SelectorTest.testCloseConnectionInClosingState sends and receives messages to get the
channel into a state with staged receives and then waits for idle timeout to close the channel.
When run with SSL, the channel may have buffered bytes that prevent the channel from being
closed. Updated the test to wait until there are no buffered bytes as well.
    
    Reviewers: Ismael Juma <ismael@juma.me.uk>
---
 .../src/test/java/org/apache/kafka/common/network/SelectorTest.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java b/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
index 2da1cc6..9d48ab5 100644
--- a/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
+++ b/clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
@@ -493,8 +493,10 @@ public class SelectorTest {
             do {
                 selector.poll(1000);
             } while (selector.completedReceives().isEmpty());
-        } while (selector.numStagedReceives(channel) == 0 && --retries > 0);
+        } while (selector.numStagedReceives(channel) == 0 && !channel.hasBytesBuffered()
&& --retries > 0);
         assertTrue("No staged receives after 100 attempts", selector.numStagedReceives(channel)
> 0);
+        // We want to return without any bytes buffered to ensure that channel will be closed
after idle time
+        assertFalse("Channel has bytes buffered", channel.hasBytesBuffered());
 
         return channel;
     }


Mime
View raw message