You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Íñigo Goiri (JIRA)" <ji...@apache.org> on 2018/05/30 00:48:00 UTC
[jira] [Commented] (HDFS-13637) RBF: Router fails when threadIndex
(in ConnectionPool) wraps around Integer.MIN_VALUE
[ https://issues.apache.org/jira/browse/HDFS-13637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494537#comment-16494537 ]
Íñigo Goiri commented on HDFS-13637:
------------------------------------
We already have 3 new JIRAs on the RPC client topic; we may want to create an umbrella/branch just for this effort.
Potentially, we could move there HDFS-13232, HDFS-13230, HDFS-13289, and others related there.
> 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: Major
> Labels: RBF
>
> {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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org