Ticket #42 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

hellanzb runs out of file descriptors

Reported by: hellanzb.com@… Owned by: pjenvey
Priority: normal Milestone:
Component: PostProcessor Version:
Severity: major Keywords: file descriptors garbage collector
Cc:

Description

I'm running Linux and Python 2.3.5 with Gentoo patches.

The *_ENC files opened in fetchNextNZBSegment in source:trunk/Hellanzb/NZBLeecher/__init__.py seem not to be closed until I have to kill python because it runs out of allowed file descriptors.

I added self.currentSegment.encodedData.close() between the following lines:

debug(str(self) + ' All groups failed, requeueing to another pool!')
self.currentSegment = None

It fixed the problem for me, but in my understanding it shouldn't be neccessary, as self.currentSegment.encodedData should be garbage collected when self.currentSegment is undefined.

Maybe it's a bug in Python's garbage collector or the Gentoo distribution's patches.

I would try to debug the actual issue, but unfortunately i'm sick at the moment; i don't have energy to do that.

Change History

Changed 7 years ago by pjenvey

  • status changed from new to closed
  • resolution set to fixed

thanks for pointing this out. Even if GC could/should handle cleaning up all of these file handles, we should be closing them anyway

I'm now closing them at that place you pointed out and a few other places in NZBLeecher where they could be left open

This fix is in revision [452], let me know if there's any trouble with this patch. (FYI I'm aiming to release v0.7 from trunk in a day or two ;) )

Note: See TracTickets for help on using tickets.