MediaWikiServices::getLocalServerObjectCache() will currently return an EmptyBagOStuff in maintenance scripts, leading to performance degradation for batch jobs (e.g. T254430). Getting a non-functioning cache seems surprising. Perhaps we should default to a HashBagOStuff instead, so the cache will work at least transiently.
The root cause of this is the logic in ObjectCache::makeLocalServerCache() which is used by the wiring for 'LocalServerObjectCache'. Perhaps we want the wiring to call ObjectCache::getLocalServerInstance( 'hash' ) instead. However, ObjectCache::getLocalServerInstance() currently uses MediaWikiServices::getLocalServerObjectCache() , so this relationship would have to be inverted.
Usages of MediaWikiServices::getLocalServerObjectCache():
https://codesearch.wmcloud.org/search/?q=getLocalServerObjectCache&i=nope&files=&repos=