Skip to content

Commit 39fd2a8

Browse files
author
phuchong.tran
committed
Default FetchRequestManager.isUnavailable to return false and maybeThrowAuthFailure to perform no ops
1 parent e6f2624 commit 39fd2a8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Diff for: clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchRequestManager.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,22 @@ public class FetchRequestManager extends AbstractFetch implements RequestManager
5555
this.networkClientDelegate = networkClientDelegate;
5656
}
5757

58+
/**
59+
* Node's availability will be checked at a later stage, so we default to return false;
60+
* @param node {@link Node} to check for availability
61+
* @return
62+
*/
5863
@Override
5964
protected boolean isUnavailable(Node node) {
60-
return networkClientDelegate.isUnavailable(node);
65+
return false;
6166
}
6267

68+
/**
69+
* Authentication failure will be checked at a later stage, so we do nothing here
70+
* @param node {@link Node} to check for a previous {@link AuthenticationException}; if found it is thrown
71+
*/
6372
@Override
64-
protected void maybeThrowAuthFailure(Node node) {
65-
networkClientDelegate.maybeThrowAuthFailure(node);
66-
}
73+
protected void maybeThrowAuthFailure(Node node) {}
6774

6875
/**
6976
* {@inheritDoc}

Diff for: clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetchRequestManagerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,10 @@ public void testFetchSkipsBlackedOutNodes() {
781781
Node node = initialUpdateResponse.brokers().iterator().next();
782782

783783
client.backoff(node, 500);
784-
assertEquals(0, sendFetches());
784+
assertEquals(1, sendFetches());
785785

786786
time.sleep(500);
787-
assertEquals(1, sendFetches());
787+
assertEquals(0, sendFetches());
788788
}
789789

790790
@Test

0 commit comments

Comments
 (0)