Skip to content

QueueFeederThread not Joined when Controller Exists #53

Open

Description

@christianbrugger

Currently in many tests there are unjoined threads, after running the tests. Many of them are QueueFeederThread that are part of the multiprocessing.Queue implementation. I suggest we close them somewhere with:

self.scene._controller._channel_in.close()
self.scene._controller._channel_in.join_thread()
self.scene._controller._channel_out.close()
self.scene._controller._channel_out.join_thread()

@hacst what would be the best place to close these threads?

Currently more than 30 unittests fail because of this issue. To enables detection of unjoined thread remove the line: https://github.com/LogikSim/LogikSim/blob/master/src/tests/helpers.py#L164

Activity

  1. hacst commented on Jan 11, 2015

    @hacst
    Member

    We'll need to add explicit shutdown functions to all our classes that create such objects and make sure to call them throughout the hierarchy. Kind of a pita but without RAII there's not much you can do to work around this. We'll probably want to move the creation of these queues out of the controller somewhere that already deals with application lifetime. We'll need that later anyways so we can actually use multiple processes. It'll probably end up - in wrapped form - where we currently setup the backend/shutdown stuff.

    Beyond precisely controlling the life-time what we can also investigate is why exactly they aren't joined on shutdown. I'd assume python guarantees us to call __del__ on them during shutdown so the issue is probably that they don't force a join there. If that is the case adding that on the queue itself might be enough to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions