hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duo Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-14759) Avoid using Math.abs when selecting SyncRunner in FSHLog
Date Wed, 04 Nov 2015 09:49:27 GMT
Duo Zhang created HBASE-14759:

             Summary: Avoid using Math.abs when selecting SyncRunner in FSHLog
                 Key: HBASE-14759
                 URL: https://issues.apache.org/jira/browse/HBASE-14759
             Project: HBase
          Issue Type: Bug
          Components: wal
            Reporter: Duo Zhang

int index = Math.abs(this.syncRunnerIndex++) % this.syncRunners.length;
          try {
            this.syncRunners[index].offer(sequence, this.syncFutures, this.syncFuturesCount);
          } catch (Exception e) {
            // Should NEVER get here.
            this.exception = new DamagedWALException("Failed offering sync", e);
Math.abs will return Integer.MIN_VALUE if you pass Integer.MIN_VALUE in since the actual absolute
value of Integer.MIN_VALUE is out of range.

I think {{this.syncRunnerIndex++}} will overflow eventually if we keep the regionserver running
for enough time.

This message was sent by Atlassian JIRA

View raw message