HBASE-4473 NPE when executors are down but events are still coming in
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1178520 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cb845c04d8
commit
4ecbf3c8c0
|
@ -689,6 +689,7 @@ Release 0.90.5 - Unreleased
|
|||
HBASE-4295 rowcounter does not return the correct number of rows in
|
||||
certain circumstances (David Revell)
|
||||
HBASE-4515 User.getCurrent() can fail to initialize the current user
|
||||
HBASE-4473 NPE when executors are down but events are still coming in
|
||||
|
||||
IMPROVEMENT
|
||||
HBASE-4205 Enhance HTable javadoc (Eric Charles)
|
||||
|
|
|
@ -213,9 +213,6 @@ public class ExecutorService {
|
|||
|
||||
Executor getExecutor(String name) {
|
||||
Executor executor = this.executorMap.get(name);
|
||||
if (executor == null) {
|
||||
LOG.debug("Executor service [" + name + "] not found in " + this.executorMap);
|
||||
}
|
||||
return executor;
|
||||
}
|
||||
|
||||
|
@ -231,7 +228,16 @@ public class ExecutorService {
|
|||
}
|
||||
|
||||
public void submit(final EventHandler eh) {
|
||||
getExecutor(getExecutorServiceType(eh.getEventType())).submit(eh);
|
||||
Executor executor = getExecutor(getExecutorServiceType(eh.getEventType()));
|
||||
if (executor == null) {
|
||||
// This happens only when events are submitted after shutdown() was
|
||||
// called, so dropping them should be "ok" since it means we're
|
||||
// shutting down.
|
||||
LOG.error("Cannot submit [" + eh + "] because the executor is missing." +
|
||||
" Is this process shutting down?");
|
||||
} else {
|
||||
executor.submit(eh);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -124,6 +124,15 @@ public class TestExecutorService {
|
|||
// Make sure threads are still around even after their timetolive expires.
|
||||
Thread.sleep(executor.keepAliveTimeInMillis * 2);
|
||||
assertEquals(maxThreads, pool.getPoolSize());
|
||||
|
||||
executorService.shutdown();
|
||||
|
||||
assertEquals(0, executorService.getAllExecutorStatuses().size());
|
||||
|
||||
// Test that submit doesn't throw NPEs
|
||||
executorService.submit(
|
||||
new TestEventHandler(mockedServer, EventType.M_SERVER_SHUTDOWN,
|
||||
lock, counter));
|
||||
}
|
||||
|
||||
private void checkStatusDump(ExecutorStatus status) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue