[luci] httpclient - missing sock:close() ?

Helen Fornazier helen at wizzilab.com
Thu Feb 6 13:09:40 CET 2014


Hi all,

I was reading the code of httpclient (here it its code
http://luci.subsignal.org/trac/browser/luci/trunk/libs/httpclient/luasrc/httpclient.lua)
and in the line 336 (before the last return of the function request_raw) it
shouldn't have a sock:close() ?


I am asking this because I am using httpclient to perform GETs periodically
(each 30 seconds), but after a while the function request_to_buffer blocks
and does not return.
I check with netstat -np and I saw lots of CLOSE_WAIT state like:

tcp        1      0 127.0.0.1:38842         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:38937         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:37841         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:38625         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:38172         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:37761         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:37706         127.0.0.1:80
CLOSE_WAIT  18603/lua
tcp        1      0 127.0.0.1:37997         127.0.0.1:80
CLOSE_WAIT  18603/lua
....
(there is more, I won't recopy all of them here)

Where 18603 is the PID of the process executing the request_to_buffer from
time to time.

So I was wondering if the missing sock:close() wouldn't be the reason.
I didn't test adding the sock:close() because it takes a long time to
reproduce the blockage.

Maybe it is a dummy question, sorry if it is so, but I would be glad if
someone could at least explain me why it is not missing the sock:close()

Thanks


Helen Fornazier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20140206/5f6f10b8/attachment.html>


More information about the luci mailing list