HBASE-2077 NullPointerException with an open scanner that expired causing

an immediate region server shutdown (Sam Pullara via JD)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@894553 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2009-12-30 07:38:02 +00:00
parent 6802181855
commit 58039a7bc2
2 changed files with 7 additions and 3 deletions

View File

@ -142,6 +142,8 @@ Release 0.21.0 - Unreleased
HBASE-2026 NPE in StoreScanner on compaction
HBASE-2072 fs.automatic.close isn't passed to FileSystem
HBASE-2075 Master requires HDFS superuser privileges due to waitOnSafeMode
HBASE-2077 NullPointerException with an open scanner that expired causing
an immediate region server shutdown (Sam Pullara via JD)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -183,11 +183,13 @@ public class Leases extends Thread {
public void renewLease(final String leaseName) throws LeaseException {
synchronized (leaseQueue) {
Lease lease = leases.get(leaseName);
if (lease == null) {
// We need to check to see if the remove is successful as the poll in the run()
// method could have completed between the get and the remove which will result
// in a corrupt leaseQueue.
if (lease == null || !leaseQueue.remove(lease)) {
throw new LeaseException("lease '" + leaseName +
"' does not exist");
"' does not exist or has already expired");
}
leaseQueue.remove(lease);
lease.setExpirationTime(System.currentTimeMillis() + leasePeriod);
leaseQueue.add(lease);
}