listCollections only requires intent locks (MODE_IS).
- db.CollectionInfos + db.collectionNames (double check how we phrase nameOnly – IS lock)
Currently the listCollections command requires a MODE_S lock on the database it's run on. When any transaction is active on that database, it will generally have a MODE_IX lock on a collection. This will conflict with the MODE_S lock on the database, causing listCollections to block until the transaction is finished or aborted.
It should be sufficient to have the MODE_IS lock on the database, as long as each collection is locked as its details are gathered.