Thread View: news.software.nntp
1 messages
1 total messages
Started by Etian
Fri, 26 Jun 2009 23:06
NntpCache 3.0.2 uses up *ALL* file descriptors (fixed)
Author: Etian
Date: Fri, 26 Jun 2009 23:06
Date: Fri, 26 Jun 2009 23:06
26 lines
1886 bytes
1886 bytes
I've been playing with nntpcache, and after hitting it hard for a long
session, it crashed other programs (including INN) which couldn't open
files. lsof showed that each process in nntpcache was opening files and
never closing them until the nntp session was closed, building up
thousands of file descriptors. So I went through article.c, looking for
open commands whose close commands might have fallen out of a loop. And
here is what I found:
In lines 554- 572 of src/article.c:
fd = open (artfile, O_RDONLY);
if (fd >= 0)
{do a bunch of stuff
} else
close (fd);
fd = -1;
The close is skipped when the open is successful, and only picked up by
the else clause, which should simply be deleted:
};
close (fd);
fd = -1;
This appears to have fixed the problem.
Etian
sonic-news
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads