Search code examples
pythonpdbeventletipdbnameko

eventlet.monkey_patch() breaks ipdb in docker container


So I am using the micro-servicing python package nameko which runs a service using eventlet and calls eventlet.monkey_patch() on import.

I have deciphered that it is this piece of code that is blocking any debug attempts via ipdb. The ipdb console shows in the terminal but I cannot type anything and have to close the entire terminal session in order to quit the process.

The stuck console looks like: enter image description here

How can I use ipdb with this function?

EDIT: This issue only seems to happen when within a docker container.


Solution

  • Sorry, no convenient solution, for now your best option is to skip docker when using ipdb (you can extract filesystem image from docker and run it in another virtualisation, such as qemu, Virtualbox, systemd-nspawn). See https://github.com/larsks/undocker for help.

    Other things to try (may not work, please share results):

    • update eventlet to github master pip install https://github.com/eventlet/eventlet/archive/master.zip

    This issue is cross posted here https://github.com/eventlet/eventlet/issues/361