I'll copy my explanation from that ticket here. On Mac and Windows, the Python interpreter locks around calls to getaddrinfo:
A comment explains these are "systems on which getaddrinfo() is believed to not be thread-safe."
When Motor opens a new connection to MongoDB it starts a timer, then calls getaddrinfo on the server address. If many other getaddrinfo calls are already enqueued, then Motor's call can spend more than connectTimeoutMS waiting in the queue for the getaddrinfo lock. The timer expires and raises AutoReconnect.
It appears as if Motor can't connect to MongoDB, when in fact it simply couldn't acquire the getaddrinfo lock in time.
So in the case of your script, specifically, you open one connection to MongoDB in order to run articles.drop(). That connection requires a call to getaddrinfo with "localhost", which succeeds. Then you start 500 calls to getaddrinfo for all the feeds' domains, and as feeds are fetched you insert them into MongoDB. At some point, you begin an insert while another insert is in progress, so Motor tries to open a new MongoDB connection so it can start the second insert concurrently. That's when things go wrong: since you have hundreds of getaddrinfo calls still in progress, the new connection queues waiting for the getaddrinfo lock so it can resolve "localhost". After 20 seconds it gives up and raises AutoReconnect. Meanwhile, dozens of other Motor connections have queued behind this one, and they fail too.
If you reduce the number of feeds to 100, the chances that a Motor call to getaddrinfo will wait more than 20 seconds are lower, so you are less likely to see an AutoReconnect exception.
Workarounds: use Linux, where Python considers getaddrinfo thread-safe and does not lock around getaddrinfo calls. Or set max pool size to 1:
client = motor.motor_asyncio.AsyncIOMotorClient("mongodb://localhost:27017/test", max_pool_size=1)
This prevents Motor from trying to open more connections after you begin the feed-fetcher, so Motor never gets stuck in the queue behind the fetcher waiting for the getaddrinfo lock.
I'm going to ask the asyncio maintainers for advice on this issue. I think the bugfix for Motor should be to start the timer after getaddrinfo succeeds, which will make it behave more like PyMongo does in a multithreaded application.