HBASE-10046 Unmonitored HBase service could accumulate Status objects and OOM
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1546094 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
69daad5a47
commit
e77e82c5c1
|
@ -73,8 +73,9 @@ public class TaskMonitor {
|
|||
new Class<?>[] { MonitoredTask.class },
|
||||
new PassthroughInvocationHandler<MonitoredTask>(stat));
|
||||
TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
|
||||
synchronized (this) {
|
||||
tasks.add(pair);
|
||||
if (tasks.size() > MAX_TASKS) {
|
||||
purgeExpiredTasks();
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
|
@ -87,8 +88,9 @@ public class TaskMonitor {
|
|||
new Class<?>[] { MonitoredRPCHandler.class },
|
||||
new PassthroughInvocationHandler<MonitoredRPCHandler>(stat));
|
||||
TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
|
||||
synchronized (this) {
|
||||
tasks.add(pair);
|
||||
if (tasks.size() > MAX_TASKS) {
|
||||
purgeExpiredTasks();
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue