HBASE-13146 Race Condition in ScheduledChore and ChoreService

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
zhangduo 2015-03-03 22:44:10 +08:00 committed by stack
parent 2c02f2f154
commit 0c4c60a99e

View File

@ -131,10 +131,10 @@ public class ChoreService implements ChoreServicer {
if (chore == null) return false;
try {
chore.setChoreServicer(this);
ScheduledFuture<?> future =
scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(),
chore.getTimeUnit());
chore.setChoreServicer(this);
scheduledChores.put(chore, future);
return true;
} catch (Exception exception) {