reaping fd's and flushing buffers

Sure enough, after I say that all my fd reaping issues are solved at the Haskell level, I've been bitten by issues that look like the RTS doing things behind my back wrt. reaping fd's etc. etc. Basically, while I used socketToHandle the fd's got closed prematurely, and once I eliminated all uses of it, the socket fd's appeared to leak despite attempts to explicitly close them. Also, there were some very strange goings-on with respect to attempts to flush buffers after the fd's they were being flushed to were closed. So, what are the semantics here? Bill

perhaps this is related to these errors i get after my program runs for a while (about 2 days): I am guessing the no such protocol entry is because it cant open the /etc/protocols file due to a lack of fds. it is almost as if file descriptors are not being closed and leaking over time... ConnectionError ugcs.caltech.edu gale.ugcs.caltech.edu ugcs.caltech.edu.gale.org. (retrying in 5.0s): does not exist Action: getProtocolByName Reason: no such protocol entry ConnectionError ugcs.caltech.edu gale.ugcs.caltech.edu ugcs.caltech.edu.gale.org. (retrying in 5.0s): does not exist Action: getProtocolByName Reason: no such protocol entry ConnectionError ugcs.caltech.edu gale.ugcs.caltech.edu ugcs.caltech.edu.gale.org. (retrying in 5.0s): does not exist Action: getProtocolByName Reason: no such protocol entry ConnectionError ugcs.caltech.edu gale.ugcs.caltech.edu ugcs.caltech.edu.gale.org. (retrying in 5.0s): does not exist Action: getProtocolByName Reason: no such protocol entry ConnectionError ugcs.caltech.edu gale.ugcs.caltech.edu ugcs.caltech.edu.gale.org. (retrying in 5.0s): does not exist Action: getProtocolByName Reason: no such protocol entry ConnectionError ugcs.caltech.edu gale.ugcs.caltech.edu ugcs.caltech.edu.gale.org. (retrying in 5.0s): does not exist Action: getProtocolByName Reason: no such protocol entry attempt ExceptionCaught resource exhausted Action: openFile Reason: Too many open files File: /home/john/.gale/ginsu.pufflog.momenergy.repetae.net.4925.1041460077.1299 On Thu, Jan 02, 2003 at 11:15:28PM -0800, William Lee Irwin III wrote:
Sure enough, after I say that all my fd reaping issues are solved at the Haskell level, I've been bitten by issues that look like the RTS doing things behind my back wrt. reaping fd's etc. etc.
Basically, while I used socketToHandle the fd's got closed prematurely, and once I eliminated all uses of it, the socket fd's appeared to leak despite attempts to explicitly close them.
Also, there were some very strange goings-on with respect to attempts to flush buffers after the fd's they were being flushed to were closed.
So, what are the semantics here?
Bill _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------

On Fri, Jan 03, 2003 at 03:06:48AM -0800, John Meacham wrote:
perhaps this is related to these errors i get after my program runs for a while (about 2 days): I am guessing the no such protocol entry is because it cant open the /etc/protocols file due to a lack of fds. it is almost as if file descriptors are not being closed and leaking over time...
I removed the getProtocolByName path by using a raw integer port number and the error(s) still occurred. By listing /proc/$PID/fd I determined that they were sockets (which are listed in a special format). That investigation was prompted by strace(1)'s results, which indicated that the error returned was -EMFILE from socket(2). Bill
participants (2)
-
John Meacham
-
William Lee Irwin III