Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

descriptor too large for set size #176

Open
cvuillemez opened this issue Oct 29, 2017 · 7 comments
Open

descriptor too large for set size #176

cvuillemez opened this issue Oct 29, 2017 · 7 comments

Comments

@cvuillemez
Copy link
Contributor

Hello,
I'm experiencing an important issue when using tcp.lua with lots of client connections.
The plugin crashes and report this information:

1509130702213999114 [info] input.tcp detaching received: 1 msg: process_message() /usr/share/luasandbox/sandboxes/heka/input/tcp.lua:118: bad argument #1 to 'select' (descriptor too large for set size)

It appears this plugin is not directly in question, but the lib LuaSocket is.
When Hindsight holds at least FD_SETSIZE open file descriptors, socket.select() returns an error. FD_SETSIZE is defined to 1024 by a macro in Glibc (doc).

socket.select() leverages on this macro, so when I start few hundreds of TCP clients, total of open file descriptor goes quickly above 1024 (with my settings, when no clients are connected, Hindsight still has ~250 fd, so the 1024 value is very limiting, especially for infrastructure which need to connect thousands of clients).

Maybe I could start more (Hindsight) instances to spread connections, but it's not a good choice, I can't be sure they will always be well distributed, and any program could flood input and makes plugin to crash.

This LuaSocket limitation is mentionned in this issue, where @diegonehab suggest to use libevent .

Regards.

@cvuillemez
Copy link
Contributor Author

Any idea about this issue ? I think it can be so problematic ... 1024 open files is easilly reached.

@diegonehab
Copy link

diegonehab commented Jan 24, 2018 via email

@cvuillemez
Copy link
Contributor Author

@trink ?

@trink
Copy link
Contributor

trink commented Jan 31, 2018

This isn't work we can take on at the moment.

@cvuillemez
Copy link
Contributor Author

@diegonehab : the todo work is completely inside LUA socket project so I suppose there is for now no contributor to implement this feature ? It sounds strange for me .. it means all applications using LUA in the world don't need to manage large sets of socket/file descriptors , or maybe they use another LUA lib (?)

@diegonehab
Copy link

diegonehab commented Feb 6, 2018 via email

@cvuillemez
Copy link
Contributor Author

OK I have a better undestanding of the context. But now I don't understand why a so important module is not developped / maintained by the LUA team.
Now It appears this bug will certainly not be solved soon ... but thanks to you for your (free) work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants