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
{{ message }}
Repository navigation
close sockets eagerly in Lwt_io.establish_server #225
, it seems that establish_server doesn't close the FDs itself. A server receiving lots of short-lived connections quickly blocks by FD starvation, unless on closes the two channels manually. I think the channels should be closed by establish_server itself by default (or at least providing an optional flag to enable it), à la with_file, etc..
Actually it seems that each call to the callback blocks the entire establish_server thread, so the callback should return quickly, or use Lwt.async to do the real work, which is a recipe for FD leak. Then maybe what would be nice is establish_server_async with, roughly, the same signature as establish_server, except the callback returns a unit Lwt.t and is wrapped into the safe file-closing behavior.
Activity
c-cube commentedon Mar 27, 2016
Actually it seems that each call to the callback blocks the entire
establish_serverthread, so the callback should return quickly, or useLwt.asyncto do the real work, which is a recipe for FD leak. Then maybe what would be nice isestablish_server_asyncwith, roughly, the same signature asestablish_server, except the callback returns aunit Lwt.tand is wrapped into the safe file-closing behavior.aantron commentedon Apr 28, 2016
Appears to be a duplicate of #208.