[ https://issues.apache.org/jira/browse/HDFS-13637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Íñigo Goiri updated HDFS-13637: ------------------------------- Resolution: Fixed Hadoop Flags: Reviewed Fix Version/s: 3.0.4 2.9.2 3.1.1 3.2.0 2.10.0 Status: Resolved (was: Patch Available) Thanks [~crh] for the fix. Committed to trunk, branch-3.1, branch-3.0, branch-2.10, and branch-2.9. [~linyiqun], note that this is a critical bugfix and I went ahead and committed. > RBF: Router fails when threadIndex (in ConnectionPool) wraps around > Integer.MIN_VALUE > ------------------------------------------------------------------------------------- > > Key: HDFS-13637 > URL: https://issues.apache.org/jira/browse/HDFS-13637 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: federation > Reporter: CR Hota > Assignee: CR Hota > Priority: Critical > Labels: RBF > Fix For: 2.10.0, 3.2.0, 3.1.1, 2.9.2, 3.0.4 > > Attachments: HDFS-13637.0.patch, HDFS-13637.1.patch, > HDFS-13637.2.patch, HDFS-13637.3.patch > > > {code:java} > int threadIndex = this.clientIndex.getAndIncrement(); > for (int i=0; i<size; i++) { > int index = (threadIndex + i) % size; > conn = tmpConnections.get(index); > if (conn != null && conn.isUsable()) { > return conn; > } > } > {code} > The above code in ConnectionPool.java getConnection method throws > java.lang.ArrayIndexOutOfBoundsException when clientIndex wraps to > Integer.MIN_VALUE and makes router reject all requests. threadIndex should be > reset to 0. > {code:java} > if (threadIndex < 0) { > // Wrap around 0 to keep array lookup index positive > this.clientIndex.set(0); > threadIndex = this.clientIndex.getAndIncrement(); > } > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org