notnoop/java-c2dm — Issue #5: C2DMPooledService closes connectionpool before executorservice.
Author: Mopper
Created: 2011-11-26 15:32:40+00:00
State: open

In the current version of the C2DMPooledService, the htttpClient's connectionpool is closed before the executor has been shutdown. This may cause Runnables to be executed when the http connectionpool is no longer available. I would suggest changing it to something along these lines:

@Override
public void stop() {
super.stop();
this.executor.shutdown();
try {
this.executor.awaitTermination(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
}
this.httpClient.getConnectionManager().shutdown();
}