Shutdown pool on success or failure