http://www.perlmonks.org?node_id=1069504


in reply to invalid header received at /usr/local/lib/perl/5.10.1/MongoDB/Cursor.pm line 160.

... and a minimal example of the code that exhibits this behavior is ...
            where?

Your supposition about the problem may be valid, but it's very hard to help you solve it without knowing more, such as 'is N the highest active thread?'
If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.