This is racey with regard to shutdown. The executor can be shut down in between the if(internalShutdown) check and the future being added to the map