Skip to content

unresponsive after gevent.monkey.patch_all() #112

Open

Description

@JohnLunzer

as it says, after I run:

from gevent import monkey; monkey.patch_all()

ptpython becomes unresponsive with no error message. There may be a clue from running ptipython I get this error message before the terminal becomes unresponseive:

The history saving thread hit an unexpected error (LoopExit('This operation would block forever',)).History will not be written to the databa.

I'm using git clones of ptpython and prompt-toolkit from about an hour ago.

Activity

  1. jonathanslenders commented on May 2, 2016

    @jonathanslenders
    Member

    Thanks for this. Not sure what's going on, but this needs some investigation.

  2. mguijarr commented on Jun 21, 2016

    @mguijarr

    I experienced the same issue, I could workaround it temporarily by doing:

    from gevent import monkey; monkey.patch_all(thread=False)

    (of course, threads are not replaced by greenlets in this case, but this was ok for me)

    Unfortunately it brought another problem: in the posix event loop some threads are created,
    and for some reason it was not properly cleaned up so each time a thread was created it was
    opening a new file descriptor for a new gevent loop (one for each thread, since they are not
    patched), and left it opened until the limit of opened files was reached.

    I decided to go for my own gevent-friendly event loop, hopefully I will soon make a PR for the
    project if people are interested ?

  3. JohnLunzer commented on Jun 21, 2016

    @JohnLunzer
    Author

    Definitely interested in a fix. Thank you for looking into it more deeply than I did.

  4. mguijarr commented on Jul 13, 2016

    @mguijarr

    I finally made a PR, I hope it helps - I do not have much time to dedicate on this, but at least you should see how I solved the problem.

    I realize a new event loop should probably go to the prompt-toolkit project ?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions