You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Nitay Joffe (JIRA)" <ji...@apache.org> on 2008/11/13 20:20:44 UTC

[jira] Created: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
--------------------------------------------------------------------------------

                 Key: HBASE-1000
                 URL: https://issues.apache.org/jira/browse/HBASE-1000
             Project: Hadoop HBase
          Issue Type: Bug
          Components: util
            Reporter: Nitay Joffe
            Priority: Trivial


When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.

Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:

  public void sleep(final long startTime) {
    if (this.stop.get()) {
      return;
    }
    long now = System.currentTimeMillis();
    long waitTime = this.period - (now - startTime);
    if (waitTime > this.period) {
      LOG.warn("Calculated wait time > " + this.period +
        "; setting to this.period: " + System.currentTimeMillis() + ", " +
        startTime);
    }
    if (waitTime > 0) {
      try {
        Thread.sleep(waitTime);
        long slept = System.currentTimeMillis() - now;
        if (slept > (10 * this.period)) {
          LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
            this.period);
        }
      } catch(InterruptedException iex) {
        // We we interrupted because we're meant to stop?  If not, just
        // continue ignoring the interruption
        if (this.stop.get()) {
          return;
        }
      }
    }
  }

Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-1000:
-------------------------

    Attachment: 1000-v3.patch

Save on System.currentTimeMillis calls.

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>             Fix For: 0.19.0
>
>         Attachments: 1000-v3.patch, hbase-1000-v2.patch, hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack resolved HBASE-1000.
--------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]

Committed.  Thanks for the review Nitay.  Made your suggested fixes.

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>             Fix For: 0.19.0
>
>         Attachments: 1000-v3.patch, hbase-1000-v2.patch, hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "Nitay Joffe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nitay Joffe updated HBASE-1000:
-------------------------------

    Description: 
When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.

Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
{code}
  public void sleep(final long startTime) {
    if (this.stop.get()) {
      return;
    }
    long now = System.currentTimeMillis();
    long waitTime = this.period - (now - startTime);
    if (waitTime > this.period) {
      LOG.warn("Calculated wait time > " + this.period +
        "; setting to this.period: " + System.currentTimeMillis() + ", " +
        startTime);
    }
    if (waitTime > 0) {
      try {
        Thread.sleep(waitTime);
        long slept = System.currentTimeMillis() - now;
        if (slept > (10 * this.period)) {
          LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
            this.period);
        }
      } catch(InterruptedException iex) {
        // We we interrupted because we're meant to stop?  If not, just
        // continue ignoring the interruption
        if (this.stop.get()) {
          return;
        }
      }
    }
  }
{code}
Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

  was:
When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.

Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:

  public void sleep(final long startTime) {
    if (this.stop.get()) {
      return;
    }
    long now = System.currentTimeMillis();
    long waitTime = this.period - (now - startTime);
    if (waitTime > this.period) {
      LOG.warn("Calculated wait time > " + this.period +
        "; setting to this.period: " + System.currentTimeMillis() + ", " +
        startTime);
    }
    if (waitTime > 0) {
      try {
        Thread.sleep(waitTime);
        long slept = System.currentTimeMillis() - now;
        if (slept > (10 * this.period)) {
          LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
            this.period);
        }
      } catch(InterruptedException iex) {
        // We we interrupted because we're meant to stop?  If not, just
        // continue ignoring the interruption
        if (this.stop.get()) {
          return;
        }
      }
    }
  }

Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.


> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-1000:
-------------------------

    Attachment: hbase-1000.patch

Tripped over related issue in Chore.  Fixing this and Chore issue together.  Any chance of a review Nitay?

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>         Attachments: hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "Nitay Joffe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653631#action_12653631 ] 

Nitay Joffe commented on HBASE-1000:
------------------------------------

Duplicate local variable "woke" on line 74. Get rid of the long keyword and use the variable previously defined.

Also, the if on line 65 for the weird case where startTime is greater than now and causes a positive offset says that we're setting the waitTime to this.period,
but we don't actually do it.

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>             Fix For: 0.19.0
>
>         Attachments: 1000-v3.patch, hbase-1000-v2.patch, hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack reassigned HBASE-1000:
----------------------------

    Assignee: stack

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Assignee: stack
>            Priority: Trivial
>             Fix For: 0.19.0
>
>         Attachments: 1000-v3.patch, hbase-1000-v2.patch, hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-1000:
-------------------------

    Attachment: hbase-1000-v2.patch

Previous patch went into infinite loop; duh.  Try this one.

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>             Fix For: 0.19.0
>
>         Attachments: hbase-1000-v2.patch, hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1000) Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-1000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-1000:
-------------------------

    Fix Version/s: 0.19.0

Adding to 0.19.0.  What I saw was as follows:

{code}
2008-12-03 22:54:53,507 [regionserver/0:0:0:0:0:0:0:0:60020.majorCompactionChecker] ERROR org.apache.hadoop.hbase.regionserver.HRegionServer$MajorCompactionChecker: Caught exception
java.nio.channels.ClosedSelectorException
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source)
        at sun.nio.ch.SelectorImpl.selectNow(Unknown Source)
        at sun.nio.ch.Util.releaseTemporarySelector(Unknown Source)
        at sun.nio.ch.SocketAdaptor.connect(Unknown Source)
        at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:299)
        at org.apache.hadoop.ipc.Client$Connection.access$1700(Client.java:176)
        at org.apache.hadoop.ipc.Client.getConnection(Client.java:772)
        at org.apache.hadoop.ipc.Client.call(Client.java:685)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:216)
        at $Proxy1.getListing(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
        at $Proxy1.getListing(Unknown Source)
        at org.apache.hadoop.hdfs.DFSClient.listPaths(DFSClient.java:569)
        at org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:226)
        at org.apache.hadoop.hbase.regionserver.HStore.getLowestTimestamp(HStore.java:783)
        at org.apache.hadoop.hbase.regionserver.HStore.isMajorCompaction(HStore.java:975)
        at org.apache.hadoop.hbase.regionserver.HStore.isMajorCompaction(HStore.java:963)
        at org.apache.hadoop.hbase.regionserver.HRegion.isMajorCompaction(HRegion.java:2424)
        at org.apache.hadoop.hbase.regionserver.HRegionServer$MajorCompactionChecker.chore(HRegionServer.java:735)
        at org.apache.hadoop.hbase.Chore.run(Chore.java:65)
2008-12-03 22:54:53,509 [regionserver/0:0:0:0:0:0:0:0:60020.majorCompactionChecker] ERROR org.apache.hadoop.hbase.regionserver.HRegionServer$MajorCompactionChecker: Caught exception
java.lang.NullPointerException
        at org.apache.hadoop.ipc.Client$Connection.sendParam(Client.java:459)
        at org.apache.hadoop.ipc.Client.call(Client.java:686)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:216)
        at $Proxy1.getListing(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
        at $Proxy1.getListing(Unknown Source)
        at org.apache.hadoop.hdfs.DFSClient.listPaths(DFSClient.java:569)
        at org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:226)
        at org.apache.hadoop.hbase.regionserver.HStore.getLowestTimestamp(HStore.java:783)
        at org.apache.hadoop.hbase.regionserver.HStore.isMajorCompaction(HStore.java:975)
        at org.apache.hadoop.hbase.regionserver.HStore.isMajorCompaction(HStore.java:963)
        at org.apache.hadoop.hbase.regionserver.HRegion.isMajorCompaction(HRegion.java:2424)
        at org.apache.hadoop.hbase.regionserver.HRegionServer$MajorCompactionChecker.chore(HRegionServer.java:735)
        at org.apache.hadoop.hbase.Chore.run(Chore.java:65)
...
{code}

Kept doing above exception without a pause between.

Root issue was an OOME but nonetheless, should pause between.

> Sleeper.sleep does not go back to sleep when interrupted and no stop flag given.
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-1000
>                 URL: https://issues.apache.org/jira/browse/HBASE-1000
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>            Reporter: Nitay Joffe
>            Priority: Trivial
>             Fix For: 0.19.0
>
>         Attachments: hbase-1000.patch
>
>
> When interrupted, the Sleeper.sleep method should exit if the stop flag was given, otherwise it should continue sleeping. Currently it seems to exits regardless, which means the stop flag is meaningless.
> Here is the relevant code, from src/java/org/apache/hadoop/hbase/util/Sleeper.java:
> {code}
>   public void sleep(final long startTime) {
>     if (this.stop.get()) {
>       return;
>     }
>     long now = System.currentTimeMillis();
>     long waitTime = this.period - (now - startTime);
>     if (waitTime > this.period) {
>       LOG.warn("Calculated wait time > " + this.period +
>         "; setting to this.period: " + System.currentTimeMillis() + ", " +
>         startTime);
>     }
>     if (waitTime > 0) {
>       try {
>         Thread.sleep(waitTime);
>         long slept = System.currentTimeMillis() - now;
>         if (slept > (10 * this.period)) {
>           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
>             this.period);
>         }
>       } catch(InterruptedException iex) {
>         // We we interrupted because we're meant to stop?  If not, just
>         // continue ignoring the interruption
>         if (this.stop.get()) {
>           return;
>         }
>       }
>     }
>   }
> {code}
> Essentially, the 'if (waitTime > 0)' portion needs to change to a while loop so that the sleeping will continue after an interruption occurs. I'll attach a patch when I get around to fixing it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.