So while the old, inefficient code was desperately trying to churn out a mountain of XML, it had an object locked. Because that object was locked, any attempt to get a list of entities from the server would have to wait until it could get that object. But the code that was trying to get the list of entities had locked another object that was required to be locked in order to establish a new login session with the server.
And the event log would periodically get a whole bunch of complaints that basically boiled down to "Hey! Who bogarted my lock?"
I've merged my fix into the code line now. That should break the logjam.
I have a whole mountain of locking fixes that will eventually ship and clear out the entire channel (to continue the nautical metaphor).
This, however, is not that day.
*sigh*