Wait until all replicas have been processed before shutting down