With the mutex already acquired during collection metadata refresh here, if scheduling the worker thread fails for any reason (most likely only on shutdown), the mutex will be recursively acquired, which is not allowed.
Same problem exists for the database refresh logic here.