concurrency=eventlet leaking?

Issue #330 resolved
David Szotten created an issue

Been trying to debug a really strange error that appeared when using coverage --concurrency=eventlet ("Name or service not known: localhost)

Finally tracked it down to running out of file descriptors, and now that i know what to look for, i can see them build-up (using e.g. lsof). I had already noticed memory growing but had chalked that down to book-keeping, but i guess this might be related

are we accidentally preventing gc?

Removing the --concurrency flag stops the issue

Comments (3)

  1. David Szotten reporter

    think this small example highlights the issue:

    from weakref import WeakSet
    import eventlet
    def do():
    gts = WeakSet()
    print list(gts)
    print list(gts)
    $ coverage run
    [<eventlet.greenthread.GreenThread object at 0x1072f3cd0>]
    coverage run --concurrency=eventlet
    [<eventlet.greenthread.GreenThread object at 0x10e33ee10>]
    [<eventlet.greenthread.GreenThread object at 0x10e33ee10>]
  2. Ned Batchelder repo owner

    @davidszotten You are right, the tracer code is holding onto the eventlets too long. I think I will have to use a WeakRef in the tracing code to be sure that I don't.

  3. Log in to comment