HBASE-24454 - Read ioErrorStartTime to local temporary variable to avoid issue when it is set to -1 between greater than zero check and calculation of error duration (#1816)
Signed-off-by Anoop Sam John <anoopsamjohn@apache.org>
This commit is contained in:
parent
4d5efec767
commit
7b17e1cdaa
|
@ -1164,8 +1164,10 @@ public class BucketCache implements BlockCache, HeapSize {
|
||||||
*/
|
*/
|
||||||
private void checkIOErrorIsTolerated() {
|
private void checkIOErrorIsTolerated() {
|
||||||
long now = EnvironmentEdgeManager.currentTime();
|
long now = EnvironmentEdgeManager.currentTime();
|
||||||
if (this.ioErrorStartTime > 0) {
|
// Do a single read to a local variable to avoid timing issue - HBASE-24454
|
||||||
if (cacheEnabled && (now - ioErrorStartTime) > this.ioErrorsTolerationDuration) {
|
long ioErrorStartTimeTmp = this.ioErrorStartTime;
|
||||||
|
if (ioErrorStartTimeTmp > 0) {
|
||||||
|
if (cacheEnabled && (now - ioErrorStartTimeTmp) > this.ioErrorsTolerationDuration) {
|
||||||
LOG.error("IO errors duration time has exceeded " + ioErrorsTolerationDuration +
|
LOG.error("IO errors duration time has exceeded " + ioErrorsTolerationDuration +
|
||||||
"ms, disabling cache, please check your IOEngine");
|
"ms, disabling cache, please check your IOEngine");
|
||||||
disableCache();
|
disableCache();
|
||||||
|
|
Loading…
Reference in New Issue