ZanderXu commented on code in PR #4531:
URL: https://github.com/apache/hadoop/pull/4531#discussion_r925499772
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ConnectionPool.java:
##########
@@ -210,24 +217,22 @@ public AtomicInteger getClientIndex() {
* @return Connection context.
*/
protected ConnectionContext getConnection() {
-
this.lastActiveTime = Time.now();
-
- // Get a connection from the pool following round-robin
- ConnectionContext conn = null;
List<ConnectionContext> tmpConnections = this.connections;
- int size = tmpConnections.size();
- // Inc and mask off sign bit, lookup index should be non-negative int
- int threadIndex = this.clientIndex.getAndIncrement() & 0x7FFFFFFF;
- for (int i=0; i<size; i++) {
- int index = (threadIndex + i) % size;
- conn = tmpConnections.get(index);
- if (conn != null && conn.isUsable()) {
- return conn;
+ for (ConnectionContext tmpConnection : tmpConnections) {
Review Comment:
How about I create a new PR to fix this issue? And this PR is only for
RouterRpcClient support using multiple sockets.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]