Actions::Pulp3::Repository::Repair fails with Too Many Open FIles

The workaround does not seem to work in all cases:
https://community.theforeman.org/t/updating-foreman-2-2-1-to-2-3-1-and-katello-3-17-1-to-3-18-issue/21738/29?u=rbremer