This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't abandon jobs on normal termination
What is the correct behavior when dropping a non-empty jobs table? There are two main cases here: normal termination, and unwinding (`std::thread::panicking()`). For normal termination, it is reasonable to require that there are no pending jobs, and that the caller is responsible for explicitly waiting for all the jobs to finish. In the RLS case, we wait for all jobs on ShutdownRequest and don't spawn any jobs afterwards. For panicking, the picture is less clear. The simplest choice is just to abandon background jobs, but that means that some threads won't be waited for. This is the current solution. A more deterministic choice is to cancel the jobs (cancellation is yet to be implemented) and then wait for them to finish. The problem with this solution is that not all jobs can be cancelled immediately.
- Loading branch information