You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue where publishing messages to NSQ would eventually result in too many open files. I had code in a function that would publish a message as so:
Everytime I called that function a new file descriptor (type = sock when using lsof to monitor things) was being created, that would not go away.
I moved the creation of a the producer outside the function, so the same instance would be used each time a message is published, which has "fixed" the issue. My question, I thought defer producer.Stop() would "cleanup" and thus not cause too many open files. Thoughts?
The text was updated successfully, but these errors were encountered:
I ran into an issue where publishing messages to NSQ would eventually result in too many open files. I had code in a function that would publish a message as so:
Everytime I called that function a new file descriptor (type = sock when using lsof to monitor things) was being created, that would not go away.
I moved the creation of a the
producer
outside the function, so the same instance would be used each time a message is published, which has "fixed" the issue. My question, I thoughtdefer producer.Stop()
would "cleanup" and thus not cause too many open files. Thoughts?The text was updated successfully, but these errors were encountered: