I get this error as well using nsqd v0.2.29-alpha and go-nsq 0.3.7.
I have three consumers reading out of three channels. My HandleMessage functions all call message.DisableAutoResponse() so they can process messages asynchronously.
One of my consumers does some potentially long-running processing, so it calls message.Touch() in three different places, so that nsqd knows it's still working on the message.
When this consumer has been running for a while and I run this command
lsof | grep TCP | wc -l
I'll often see 40,000+ open TCP connections. Running this command
lsof | grep TCP
All the open connections look like this:
bag_proce 14751 14766 ubuntu 112u IPv4 3579235 0t0 TCP localhost:43709->localhost:4151 (ESTABLISHED)
bag_proce 14751 14766 ubuntu 114u IPv4 3579304 0t0 TCP localhost:43740->localhost:4151 (ESTABLISHED)
That is, they are all TCP connections to nsqd on port 4151.
As soon as I kill the consumer that's making the Touch() calls, the number of TCP connections drops from 40,000+ to a dozen or so.
If I restart that consumer, but comment out all the message.Touch() calls, the number of open TCP connections hovers around 400, which is fine. I can see connections are getting closed, and I don't get the "too many open files" error.
Is there a problem with the Touch command in the V2 API in either nsqd or go-nsq?
Andrew