Skip to content

InProcessKernelManager.shutdown_kernel doesn't release thread allocated by the kernel #160

@mdickinson

Description

@mdickinson

It looks as though creating and shutting down an in-process kernel leaks a thread.

The InProcessKernelManager.start_kernel method creates an InProcessKernel, whose iopub_thread trait creates a new IOPubThread object (wrapping a Python-level thread). I'd expect the InProcessKernelManager.shutdown_kernel to call stop on that IOPubThread method.

This was causing issues in a large test suite that created and disposed of IPython kernels; we ended up with one new thread per test, with the thread overload eventually leading to failed inter-thread communication in the Python process

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions