Follow up to T300255: Wikidata entity dumper keeps connecting to depooled host for really long time and T298485: MW scripts should reload the database config
It is taking a bit after each depool for the dumper to actually drain the connections. The solution would be to add $lbFactory->autoReconfigure() to after each batch (DumpGenerator::generateDump() I think)